コード例 #1
0
ファイル: WebUser.php プロジェクト: zwq/unpei
 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     $this->updateSession();
     $this->updateIdentity();
     $this->recordlogintime();
     $this->recordonline();
 }
コード例 #2
0
ファイル: RWebUser.php プロジェクト: fobihz/cndiesel
 /**
  * Actions to be taken after logging in.
  * Overloads the parent method in order to mark superusers.
  * @param boolean $fromCookie whether the login is based on cookie.
  */
 public function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     // Mark the user as a superuser if necessary.
     if (Rights::getAuthorizer()->isSuperuser($this->getId()) === true) {
         $this->isSuperuser = true;
     }
 }
コード例 #3
0
ファイル: WebUser.php プロジェクト: apa-narola/yiimoduledemo
 protected function afterLogin($fromCookie)
 {
     if (null !== $this->model) {
         foreach ($this->model->attributes as $key => $value) {
             $this->setState($key, $value);
         }
     }
     return parent::afterLogin($fromCookie);
 }
コード例 #4
0
ファイル: WebUser.php プロジェクト: nurielmeni/nymedia
 public function afterLogin($fromCookie)
 {
     if (parent::beforeLogout()) {
         $user = User::model()->findByPk(Yii::app()->user->id);
         $user->last_login_time = new CDbExpression('NOW()');
         $user->saveAttributes(array('last_login_time'));
         return parent::afterLogin($fromCookie);
     } else {
         return false;
     }
 }
コード例 #5
0
ファイル: GxcUser.php プロジェクト: ntquyen/GXC-CMS
 /**
  * Actions to be taken after logging in.
  * Overloads the parent method in order to mark superusers.
  * @param boolean $fromCookie whether the login is based on cookie.
  */
 public function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     // Mark the user as a superuser if necessary.
     //Get the user from the CActiveRecord
     $user = User::model()->findByPk($this->getId());
     Yii::app()->getSession()->remove('current_user');
     Yii::app()->getSession()->add('current_user', $user);
     if (Rights::getAuthorizer()->isSuperuser($this->getId()) === true) {
         $this->isSuperuser = true;
     }
 }
コード例 #6
0
ファイル: GxcUser.php プロジェクト: pramana08/GXC-CMS-2
 /**
  * Actions to be taken after logging in.
  * Overloads the parent method in order to mark superusers.
  * @param boolean $fromCookie whether the login is based on cookie.
  */
 public function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     $command = Yii::app()->db->createCommand();
     $command->select('username,user_url,display_name,email,fbuid,status,recent_login,avatar')->from('{{user}} u')->where('user_id=' . (int) $this->getId())->limit(1);
     $user = $command->queryRow();
     //Add only some neccessary field
     if ($user) {
         // Set User States here
         $this->setState('current_user', $user);
         // Set User Roles here
         $this->setState('current_roles', User::getArrayRoles($this->getId()));
         if (Rights::getAuthorizer()->isSuperuser($this->getId()) === true) {
             $this->isSuperuser = true;
         }
     } else {
         throw new CHttpException(503, t('cms', 'Error while Logging into your account. Please try again later.'));
     }
 }
コード例 #7
0
ファイル: YWebUser.php プロジェクト: sherifflight/yupe
 /**
  * Метод для действий после входа в систему:
  *
  * @param boolean $fromCookie - is authorize from cookie
  * 
  * @return parent::afterLogin()
  */
 protected function afterLogin($fromCookie)
 {
     Yii::app()->cache->clear('loggedIn' . $this->getId());
     return parent::afterLogin($fromCookie);
 }
コード例 #8
0
ファイル: WebUser.php プロジェクト: ShawnWQ/yii-user
 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     $this->updateSession();
 }
コード例 #9
0
ファイル: GxcUser.php プロジェクト: nganhtuan63/gxc-cms
 /**
  * Actions to be taken after logging in.
  * Overloads the parent method in order to mark superusers.
  * @param boolean $fromCookie whether the login is based on cookie.
  */
 public function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     // Mark the user as a superuser if necessary.
     //Get the user from the CActiveRecord
     //$user=User::model()->findByPk($this->getId());
     $command = Yii::app()->db->createCommand();
     $command->select('username,user_url,display_name,email,fbuid,status,recent_login,avatar')->from('{{user}} u')->where('user_id=' . (int) $this->getId())->limit(1);
     $user = $command->queryRow();
     //Add only some neccessary field
     if ($user) {
         Yii::app()->getSession()->remove('current_user');
         Yii::app()->getSession()->add('current_user', $user);
         if (Rights::getAuthorizer()->isSuperuser($this->getId()) === true) {
             $this->isSuperuser = true;
         }
     } else {
         throw new CHttpException(503, t('Error while Logging into your account. Please try again later.'));
     }
 }
コード例 #10
0
ファイル: UWebUser.php プロジェクト: shakyapranin/IMS
 /**
  * afterLogin 
  */
 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     $this->_updateUserState();
 }
コード例 #11
0
ファイル: YWebUser.php プロジェクト: kuzmina-mariya/4seasons
 /**
  * Метод для действий после входа в систему:
  *
  * @param boolean $fromCookie - is authorize from cookie
  *
  * @return parent::afterLogin()
  */
 protected function afterLogin($fromCookie)
 {
     Yii::app()->getCache()->clear('loggedIn' . $this->getId());
     if ($fromCookie) {
         $transaction = Yii::app()->getDb()->beginTransaction();
         try {
             $user = User::model()->active()->findByPk($this->getId());
             if (null === $user) {
                 $this->logout();
                 return false;
             }
             //перегенерировать токен авторизации
             $token = Yii::app()->userManager->tokenStorage->createCookieAuthToken($user, (int) Yii::app()->getModule('user')->sessionLifeTime * 24 * 60 * 60);
             $this->setState($this->authToken, $token->token);
             $this->setState(self::STATE_ACCESS_LEVEL, $user->access_level);
             $this->setState(self::STATE_NICK_NAME, $user->email);
             //дата входа
             $user->visit_time = new CDbExpression('NOW()');
             $user->update(['visit_time']);
             $transaction->commit();
         } catch (Exception $e) {
             $transaction->rollback();
         }
     }
     parent::afterLogin($fromCookie);
 }
コード例 #12
0
ファイル: WebUser.php プロジェクト: kenchopa/webengine
 protected function afterLogin($fromCookie)
 {
     $this->updateUserDataOnLoginSuccess($fromCookie);
     return parent::afterLogin($fromCookie);
 }
コード例 #13
0
ファイル: YWebUser.php プロジェクト: sepaker/yupe
 /**
  * Метод для действий после входа в систему:
  *
  * @param boolean $fromCookie - is authorize from cookie
  *
  * @return parent::afterLogin()
  */
 protected function afterLogin($fromCookie)
 {
     Yii::app()->cache->clear('loggedIn' . $this->getId());
     if (true === $fromCookie) {
         $user = User::model()->active()->findByPk((int) $this->getId());
         if (null === $user) {
             $this->logout();
             return false;
         }
         $this->setState(self::STATE_ACCESS_LEVEL, $user->access_level);
         $this->setState(self::STATE_NICK_NAME, $user->nick_name);
     }
     parent::afterLogin($fromCookie);
 }
コード例 #14
0
 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     //User::model()->updateLastLoginDate(Yii::app()->user->id);
 }