Пример #1
0
 function checkExternalLogin(Am_Request $request)
 {
     // Check cookies
     if ($this->getDi()->config->get('protect.php_include.remember_login', false) && !is_null($request->getCookie('amember_ru')) && !is_null($request->getCookie('amember_rp'))) {
         $this->setFromCookie(true);
         $authResult = $this->login($request->getCookie('amember_ru'), $request->getCookie('amember_rp'), $request->getClientIp(), false);
         $this->setFromCookie(false);
         if ($authResult->isValid()) {
             return $authResult;
         }
     }
     /// Check plugins login;
     $e = new Am_Event_AuthCheckLoggedIn();
     $this->getDi()->hook->call($e);
     if ($e->isSuccess()) {
         $errorResult = $this->checkUser($e->getUser(), $request->getClientIp());
         if ($errorResult) {
             return;
         }
         $this->setUser($e->getUser(), $request->getClientIp());
         $this->onSuccess();
         return new Am_Auth_Result(Am_Auth_Result::SUCCESS);
     }
 }