本文整理汇总了PHP中Authentication::logoutUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::logoutUser方法的具体用法?PHP Authentication::logoutUser怎么用?PHP Authentication::logoutUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authentication
的用法示例。
在下文中一共展示了Authentication::logoutUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
include_once dirname(__FILE__) . '/Authentication.php';
include_once dirname(__FILE__) . '/StudIPAuthentication.php';
$auth = new Authentication();
$StudIPauth = new StudIPAuthentication();
$invalidLogin = Authentication::checkLogin() == false;
$shouldLogOut = isset($_GET['action']) && $_GET['action'] == "logout";
if ($invalidLogin == true || $shouldLogOut == true) {
// the user's login is no longer valid or he requested to be logged out
Authentication::logoutUser();
}
示例2: http_delete
/**
* Sends an HTTP DELETE request.
*
* Uses HTTP DELETE request to get contents a $url
* @param string $url The URL that should be opnened.
* @param bool $authbool If true then send sessioninformation in header.
* @param string $message The Response Message e.g. 404. Argument is optional.
* @param bool $sessiondelete If true then send a new timestamp. Only necessary
* if $authbool true.
*/
function http_delete($url, $authbool, &$message = 0, $sessiondelete = false)
{
$answer = Request::delete($url, array(), '', $authbool);
if (isset($answer['status'])) {
$message = $answer['status'];
}
if ($message == "401" && $sessiondelete == false) {
Authentication::logoutUser();
}
return isset($answer['content']) ? $answer['content'] : '';
}