当前位置: 首页>>代码示例>>PHP>>正文


PHP CWebUser::afterLogin方法代码示例

本文整理汇总了PHP中CWebUser::afterLogin方法的典型用法代码示例。如果您正苦于以下问题:PHP CWebUser::afterLogin方法的具体用法?PHP CWebUser::afterLogin怎么用?PHP CWebUser::afterLogin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CWebUser的用法示例。


在下文中一共展示了CWebUser::afterLogin方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterLogin

 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     $this->updateSession();
     $this->updateIdentity();
     $this->recordlogintime();
     $this->recordonline();
 }
开发者ID:zwq,项目名称:unpei,代码行数:8,代码来源:WebUser.php

示例2: afterLogin

 /**
  * 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;
     }
 }
开发者ID:fobihz,项目名称:cndiesel,代码行数:13,代码来源:RWebUser.php

示例3: afterLogin

 protected function afterLogin($fromCookie)
 {
     if (null !== $this->model) {
         foreach ($this->model->attributes as $key => $value) {
             $this->setState($key, $value);
         }
     }
     return parent::afterLogin($fromCookie);
 }
开发者ID:apa-narola,项目名称:yiimoduledemo,代码行数:9,代码来源:WebUser.php

示例4: afterLogin

 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;
     }
 }
开发者ID:nurielmeni,项目名称:nymedia,代码行数:11,代码来源:WebUser.php

示例5: afterLogin

 /**
  * 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;
     }
 }
开发者ID:ntquyen,项目名称:GXC-CMS,代码行数:17,代码来源:GxcUser.php

示例6: afterLogin

 /**
  * 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.'));
     }
 }
开发者ID:pramana08,项目名称:GXC-CMS-2,代码行数:24,代码来源:GxcUser.php

示例7: afterLogin

 /**
  * Метод для действий после входа в систему:
  *
  * @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);
 }
开发者ID:sherifflight,项目名称:yupe,代码行数:12,代码来源:YWebUser.php

示例8: afterLogin

 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     $this->updateSession();
 }
开发者ID:ShawnWQ,项目名称:yii-user,代码行数:5,代码来源:WebUser.php

示例9: afterLogin

 /**
  * 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.'));
     }
 }
开发者ID:nganhtuan63,项目名称:gxc-cms,代码行数:25,代码来源:GxcUser.php

示例10: afterLogin

 /**
  * afterLogin 
  */
 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     $this->_updateUserState();
 }
开发者ID:shakyapranin,项目名称:IMS,代码行数:8,代码来源:UWebUser.php

示例11: afterLogin

 /**
  * Метод для действий после входа в систему:
  *
  * @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);
 }
开发者ID:kuzmina-mariya,项目名称:4seasons,代码行数:33,代码来源:YWebUser.php

示例12: afterLogin

 protected function afterLogin($fromCookie)
 {
     $this->updateUserDataOnLoginSuccess($fromCookie);
     return parent::afterLogin($fromCookie);
 }
开发者ID:kenchopa,项目名称:webengine,代码行数:5,代码来源:WebUser.php

示例13: afterLogin

 /**
  * Метод для действий после входа в систему:
  *
  * @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);
 }
开发者ID:sepaker,项目名称:yupe,代码行数:21,代码来源:YWebUser.php

示例14: afterLogin

 protected function afterLogin($fromCookie)
 {
     parent::afterLogin($fromCookie);
     //User::model()->updateLastLoginDate(Yii::app()->user->id);
 }
开发者ID:andyongithub,项目名称:joyplus-cms,代码行数:5,代码来源:IjoyplusWebUser.php


注:本文中的CWebUser::afterLogin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。