Public Member Functions | |
actionPreDispatchAdmin ($event) |
Definition at line 34 of file Observer.php.
actionPreDispatchAdmin | ( | $ | event | ) |
Definition at line 36 of file Observer.php.
00037 { 00038 $session = Mage::getSingleton('admin/session'); 00039 /* @var $session Mage_Admin_Model_Session */ 00040 $request = Mage::app()->getRequest(); 00041 $user = $session->getUser(); 00042 00043 if ($request->getActionName() == 'forgotpassword' || $request->getActionName() == 'logout') { 00044 $request->setDispatched(true); 00045 } 00046 else { 00047 if($user) { 00048 $user->reload(); 00049 } 00050 if (!$user || !$user->getId()) { 00051 if ($request->getPost('login')) { 00052 $postLogin = $request->getPost('login'); 00053 $username = $postLogin['username']; 00054 $password = $postLogin['password']; 00055 $user = $session->login($username, $password, $request); 00056 $request->setPost('login', null); 00057 } 00058 if (!$request->getParam('forwarded')) { 00059 if ($request->getParam('isIframe')) { 00060 $request->setParam('forwarded', true) 00061 ->setControllerName('index') 00062 ->setActionName('deniedIframe') 00063 ->setDispatched(false); 00064 } 00065 elseif($request->getParam('isAjax')) { 00066 $request->setParam('forwarded', true) 00067 ->setControllerName('index') 00068 ->setActionName('deniedJson') 00069 ->setDispatched(false); 00070 } else { 00071 $request->setParam('forwarded', true) 00072 ->setRouteName('adminhtml') 00073 ->setControllerName('index') 00074 ->setActionName('login') 00075 ->setDispatched(false); 00076 } 00077 return false; 00078 } 00079 } 00080 } 00081 00082 $session->refreshAcl(); 00083 }