Exemple #1
0
 protected function beforeLogout()
 {
     $userId = $this->getId();
     $date = date('Y-m-d H:i:s');
     db()->createCommand("UPDATE {{users}} SET auth_hash = NULL, updated_at = :updated_at WHERE user_id = :user_id LIMIT 1")->bindParam('user_id', $userId, PDO::PARAM_INT)->bindParam('updated_at', $date, PDO::PARAM_STR)->execute();
     return parent::beforeLogout();
 }
Exemple #2
0
 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;
     }
 }
Exemple #3
0
 protected function beforeLogout()
 {
     if (Yii::app()->user->id > 0) {
         if (Yii::app()->shoppingcart->IsActive) {
             $objCart = Yii::app()->shoppingcart;
             if ($objCart->cart_type == CartType::cart && Yii::app()->user->id > 0) {
                 Yii::log('Saving cart ' . $objCart->id . ' to customer id ' . Yii::app()->user->id, 'info', 'application . ' . __CLASS__ . " . " . __FUNCTION__);
                 $objCart->customer_id = Yii::app()->user->id;
                 try {
                     $objCart->save();
                 } catch (Exception $objExc) {
                     Yii::log('Failed to save cart with : ' . $objExc, 'error', 'application.' . __CLASS__ . "." . __FUNCTION__);
                 }
             }
         }
     }
     return parent::beforeLogout();
 }
Exemple #4
0
 protected function beforeLogout()
 {
     return parent::beforeLogout();
 }
Exemple #5
0
 /**
  * Runs the user_logout automation trigger
  *
  * @return boolean whether or not to logout
  */
 protected function beforeLogout()
 {
     X2Flow::trigger('UserLogoutTrigger', array('user' => $this->getName()));
     return parent::beforeLogout();
 }
 public function beforeLogout()
 {
     self::unsetUserCookies();
     return parent::beforeLogout();
 }
Exemple #7
0
 /**
  * @return bool
  */
 protected function beforeLogout()
 {
     if ($this->isGuest) {
         // Inutile de se déconnecter puisqu'on n'est pas connecté.
         // En outre, sans ce test, un appel redondant de logout() peut provoquer des erreurs plus loin
         // ($_SESSION est effacé)
         return false;
     }
     return parent::beforeLogout();
 }