本文整理汇总了PHP中CWebUser::beforeLogout方法的典型用法代码示例。如果您正苦于以下问题:PHP CWebUser::beforeLogout方法的具体用法?PHP CWebUser::beforeLogout怎么用?PHP CWebUser::beforeLogout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWebUser
的用法示例。
在下文中一共展示了CWebUser::beforeLogout方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeLogout
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();
}
示例2: 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;
}
}
示例3: beforeLogout
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();
}
示例4: beforeLogout
protected function beforeLogout()
{
return parent::beforeLogout();
}
示例5: beforeLogout
/**
* 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();
}
示例6: beforeLogout
public function beforeLogout()
{
self::unsetUserCookies();
return parent::beforeLogout();
}
示例7: beforeLogout
/**
* @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();
}