Public Member Functions | |
authFrontend () | |
authAdmin ($path) | |
authValidate ($headers=null) | |
authFailed () |
Definition at line 35 of file Data.php.
authAdmin | ( | $ | path | ) |
Authenticate admin and check ACL
string | $path |
Definition at line 61 of file Data.php.
00062 { 00063 $session = Mage::getSingleton('rss/session'); 00064 if ($session->isAdminLoggedIn()) { 00065 return; 00066 } 00067 list($username, $password) = $this->authValidate(); 00068 Mage::getSingleton('adminhtml/url')->setNoSecret(true); 00069 $adminSession = Mage::getModel('admin/session'); 00070 $user = $adminSession->login($username, $password); 00071 //$user = Mage::getModel('admin/user')->login($username, $password); 00072 if($user && $user->getId() && $user->getIsActive() == '1' && $adminSession->isAllowed($path)){ 00073 $session->setAdmin($user); 00074 } else { 00075 $this->authFailed(); 00076 } 00077 }
authFailed | ( | ) |
Send authenticate failed headers
Definition at line 95 of file Data.php.
00096 { 00097 Mage::helper('core/http')->authFailed(); 00098 }
authFrontend | ( | ) |
Authenticate customer on frontend
Definition at line 41 of file Data.php.
00042 { 00043 $session = Mage::getSingleton('rss/session'); 00044 if ($session->isCustomerLoggedIn()) { 00045 return; 00046 } 00047 list($username, $password) = $this->authValidate(); 00048 $customer = Mage::getModel('customer/customer')->authenticate($username, $password); 00049 if ($customer && $customer->getId()) { 00050 Mage::getSingleton('rss/session')->settCustomer($customer); 00051 } else { 00052 $this->authFailed(); 00053 } 00054 }
authValidate | ( | $ | headers = null |
) |
Validate Authenticate
array | $headers |
Definition at line 85 of file Data.php.
00086 { 00087 $userPass = Mage::helper('core/http')->authValidate($headers); 00088 return $userPass; 00089 }