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


PHP AuthUser::logout方法代码示例

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


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

示例1: ru_logout

 function ru_logout()
 {
     // Allow plugins to handle logout events
     Observer::notify('logout_requested');
     $username = AuthUser::getUserName();
     AuthUser::logout();
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
开发者ID:blr21560,项目名称:registered_users,代码行数:9,代码来源:index.php

示例2: logoutAction

 function logoutAction()
 {
     AuthUser::logout();
     header('location:index.php');
 }
开发者ID:chaobj001,项目名称:tt,代码行数:5,代码来源:LoginController.class.php

示例3: logout

 /**
  * Allows a user to logout.
  */
 function logout()
 {
     // CSRF checks
     if (isset($_GET['csrf_token'])) {
         $csrf_token = $_GET['csrf_token'];
         if (!SecureToken::validateToken($csrf_token, BASE_URL . 'login/logout')) {
             Flash::set('error', __('Invalid CSRF token found!'));
             redirect(get_url());
         }
     } else {
         Flash::set('error', __('No CSRF token found!'));
         redirect(get_url());
     }
     // Allow plugins to handle logout events
     Observer::notify('logout_requested');
     $username = AuthUser::getUserName();
     AuthUser::logout();
     // Also eat cookies that were set by JS for backend gui
     setcookie("expanded_rows", "", time() - 3600);
     setcookie("meta_tab", "", time() - 3600);
     setcookie("page_tab", "", time() - 3600);
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
开发者ID:ariksavage,项目名称:superior-optical-eyewear,代码行数:27,代码来源:LoginController.php

示例4: logout

 public function logout($force = false)
 {
     if ($force === false) {
         $force = $this->isLoggedIn();
     }
     if ($force) {
         AuthUser::logout();
         $this->currentID = false;
         $this->currentUser = false;
         $this->currentRoles = false;
         return true;
     }
     $this->_error(__("The Logout function does only work for logged-in users!"));
     return false;
 }
开发者ID:pawedWolf,项目名称:wolfcms-pawusers,代码行数:15,代码来源:class.users.php

示例5: logout

 /**
  * Allows a user to logout.
  */
 function logout()
 {
     $username = AuthUser::getUserName();
     AuthUser::logout();
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
开发者ID:chaobj001,项目名称:tt,代码行数:10,代码来源:LoginController.php

示例6: logout

 /**
  * Allows a user to logout.
  */
 function logout()
 {
     // CSRF checks
     if (isset($_GET['csrf_token'])) {
         $csrf_token = $_GET['csrf_token'];
         if (!SecureToken::validateToken($csrf_token, BASE_URL . 'login/logout')) {
             Flash::set('error', __('Invalid CSRF token found!'));
             redirect(get_url());
         }
     } else {
         Flash::set('error', __('No CSRF token found!'));
         redirect(get_url());
     }
     // Allow plugins to handle logout events
     Observer::notify('logout_requested');
     $username = AuthUser::getUserName();
     AuthUser::logout();
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
开发者ID:sindotnet,项目名称:cona,代码行数:23,代码来源:LoginController.php

示例7: isset

$_task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
$login = isset($_REQUEST['login']) ? $_REQUEST['login'] : false;
$passwd = isset($_REQUEST['passwd']) ? $_REQUEST['passwd'] : false;
$action = isset($_REQUEST['login']) ? $_REQUEST['login'] : false;
if (!$auth->isLoggedIn()) {
    $auth->login($login, $passwd);
}
$utils = new Utils();
switch ($_action) {
    case 'submit':
        if ($auth->isLoggedIn()) {
            $utils->cosRedirect('index2.php');
        } else {
            $utils->cosRedirect('index.php', NO_LOGIN);
        }
        break;
    case 'login':
        if ($auth->isLoggedIn()) {
            $utils->cosRedirect('index2.php');
        } else {
            $smarty->assign('msg', $msg);
            $smarty->display('loginForm.tpl');
        }
        break;
    case 'logout':
        $auth->logout();
        $msg = "Sesión cerrada.";
        $smarty->assign('msg', $msg);
        $smarty->display('loginForm.tpl');
        break;
}
开发者ID:peterweck,项目名称:catman,代码行数:31,代码来源:index.php

示例8: AuthUser

<?php

/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 23.02.2015
 * Time: 18:31
 */
session_start();
require_once __DIR__ . '/../models/AuthUser.php';
$UserObj = new AuthUser();
$UserObj->logout();
header('Location: ../index.php');
开发者ID:Alexandr1987,项目名称:barricade,代码行数:13,代码来源:logout.php

示例9: logout

 function logout()
 {
     AuthUser::logout();
     redirect(get_url());
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:5,代码来源:LoginController.php


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