本文整理匯總了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'] : '';
}