Пример #1
0
 function initAuthenticationObject($notification)
 {
     $auth = new Module_Login_Auth();
     Zend_Registry::set('auth', $auth);
     $action = Core_Helper::getAction();
     if (Core_Helper::getModule() === 'API' && (empty($action) || $action == 'index')) {
         return;
     }
     /* Create the cookie */
     $authCookieName = Zend_Registry::get('config')->General->login_cookie_name;
     $authCookieExpiry = 0;
     $authCookiePath = Zend_Registry::get('config')->General->login_cookie_path;
     $authCookie = new Core_Cookie($authCookieName, $authCookieExpiry, $authCookiePath);
     $defaultLogin = '******';
     $defaultTokenAuth = 'anonymous';
     if ($authCookie->isCookieFound()) {
         $defaultLogin = $authCookie->get('login');
         $defaultTokenAuth = $authCookie->get('token_auth');
     }
     $auth->setLogin($defaultLogin);
     $auth->setTokenAuth($defaultTokenAuth);
 }