Beispiel #1
0
 function onAuthCheckLoggedIn(Am_Event_AuthCheckLoggedIn $event)
 {
     $status = $this->getStatus();
     if ($status == self::LOGGED_AND_LINKED) {
         $event->setSuccessAndStop($this->linkedUser);
     }
 }
 public function loginWithPlugins()
 {
     $e = new Am_Event_AuthCheckLoggedIn();
     $e->run();
     if ($e->isSuccess()) {
         $auth = $this->getAuth();
         $errorResult = $auth->checkUser($e->getUser(), $this->_request->getClientIp());
         if ($errorResult) {
             return;
         }
         $auth->setUser($e->getUser(), $this->_request->getClientIp());
         $auth->onSuccess();
         return new Am_Auth_Result(Am_Auth_Result::SUCCESS);
     }
 }
Beispiel #3
0
 function onAuthCheckLoggedIn(Am_Event_AuthCheckLoggedIn $event)
 {
     $record = $this->getSingleLoginObject()->getLoggedInRecord();
     if (!$record || !$this->canLogin($record)) {
         return;
     }
     $user = $this->getTable()->findAmember($record);
     if (!$user) {
         return;
     }
     if ($this->getTable()->checkPassword($record, $user)) {
         $event->setSuccessAndStop($user);
         $this->skipAfterLogin = true;
     }
 }
Beispiel #4
0
 function onAuthCheckLoggedIn(Am_Event_AuthCheckLoggedIn $event)
 {
     $status = $this->getStatus();
     if ($status == self::LOGGED_AND_LINKED) {
         $event->setSuccessAndStop($this->linkedUser);
     } elseif ($status == self::LOGGED_OUT && !empty($_GET['fb_login'])) {
         $this->linkedUser->data()->set(self::FACEBOOK_LOGOUT, null)->update();
         $event->setSuccessAndStop($this->linkedUser);
     } elseif ($status == self::LOGGED_IN && $this->getDi()->request->get('fb_login')) {
         $this->linkedUser = $this->createAccount();
         $event->setSuccessAndStop($this->linkedUser);
     }
 }