Created
September 14, 2011 08:02
-
-
Save KATT/1216073 to your computer and use it in GitHub Desktop.
Non-working loginAction()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Include parent | |
require_once 'Mage/Adminhtml/controllers/CustomerController.php'; | |
class MyNamespace_CustomerLogin_CustomerController extends Mage_Adminhtml_CustomerController { | |
function loginAction() { | |
$customerID = (int) $this->getRequest()->getParam('id'); | |
$session = $this->_getSession(); | |
$session->loginById($customerID); | |
$this->_redirectUrl(Mage::getBaseUrl()); | |
} | |
/** | |
* Retrieve customer session model object | |
* | |
* @return Mage_Customer_Model_Session | |
*/ | |
protected function _getSession() { | |
return Mage::getSingleton('customer/session'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
public function indexAction() {
$session = Mage::getSingleton('customer/session');
$locaUser = $this->getUserById($userId);
$session->setCustomer($locaUser);
Mage::dispatchEvent('customer_login', array('customer'=>$locaUser));
}