本文整理汇总了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());
}
示例2: logoutAction
function logoutAction()
{
AuthUser::logout();
header('location:index.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());
}
示例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;
}
示例5: logout
/**
* Allows a user to logout.
*/
function logout()
{
$username = AuthUser::getUserName();
AuthUser::logout();
Observer::notify('admin_after_logout', $username);
redirect(get_url());
}
示例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());
}
示例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;
}
示例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');
示例9: logout
function logout()
{
AuthUser::logout();
redirect(get_url());
}