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


PHP User::logout方法代码示例

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


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

示例1: onSuccessLoginForm

 public function onSuccessLoginForm()
 {
     if ($this->user->isLoggedIn()) {
         $this->user->logout(true);
     } else {
         $this->user->login($this->identity);
     }
     $this->redirect("this");
 }
开发者ID:bauer01,项目名称:fake-login,代码行数:9,代码来源:Panel.php

示例2: __construct

 /**
  * @param User $user
  * @param callable|null $credentialsValidator
  */
 public function __construct(User $user, callable $credentialsValidator = null)
 {
     $this->user = $user;
     $this->credentialsValidator = $credentialsValidator ?: function () {
         $this->user->logout(true);
         try {
             $this->user->login(...func_get_args());
         } catch (\Exception $e) {
         }
         // Fail silently
         return $this->user->isLoggedIn() ? new UserEntity($this->user->getId()) : null;
     };
 }
开发者ID:lookyman,项目名称:nette-oauth2-server,代码行数:17,代码来源:UserRepository.php

示例3: checkIdentityAction

 protected function checkIdentityAction()
 {
     if ($this->storage->isAuthenticated()) {
         $identity = $this->storage->getIdentity();
         $action = $this->identityHash->getHashAction(is_null($identity) ? $identity : $identity->hash);
         if (is_null($action)) {
             parent::logout();
         }
         switch ($action) {
             case IdentityHash::ACTION_RELOAD:
                 try {
                     $this->login($this->getId(), NULL);
                 } catch (Trejjam\Authorization\User\ManagerException $e) {
                     $this->logout();
                 } catch (Trejjam\Authorization\User\AuthenticatorException $e) {
                     //this may not happen
                     throw $e;
                 }
                 break;
             case IdentityHash::ACTION_LOGOUT:
                 $this->logout();
                 break;
             case IdentityHash::ACTION_DESTROYED:
                 $this->logout();
                 break;
         }
     }
 }
开发者ID:trejjam,项目名称:authorization,代码行数:28,代码来源:User.php

示例4: actionLogout

 /**
  * logout action
  * @return void
  */
 public function actionLogout()
 {
     $this->user->logout();
     $this->flashMessage(_("You are succesfully log out"), "success");
     $this->redirect("login");
     return;
 }
开发者ID:OCC2,项目名称:occ2pacs,代码行数:11,代码来源:AuthenticatorPresenter.php

示例5: addEventListeners

 private function addEventListeners()
 {
     $this->onSuccess[] = function () {
         $this->user->logout();
     };
 }
开发者ID:shophp,项目名称:shophp,代码行数:6,代码来源:LogoutForm.php

示例6: handleLogout

 public function handleLogout()
 {
     $this->userContext->logout(true);
 }
开发者ID:Achse,项目名称:petrhejna,代码行数:4,代码来源:LoginControl.php

示例7: handleSignOut

 public function handleSignOut()
 {
     $this->user->logout();
     $this->onLoggedOut();
 }
开发者ID:chapcz,项目名称:Admin,代码行数:5,代码来源:AdminControl.php


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