本文整理汇总了PHP中phpCAS::logoutWithRedirectServiceAndUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP phpCAS::logoutWithRedirectServiceAndUrl方法的具体用法?PHP phpCAS::logoutWithRedirectServiceAndUrl怎么用?PHP phpCAS::logoutWithRedirectServiceAndUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpCAS
的用法示例。
在下文中一共展示了phpCAS::logoutWithRedirectServiceAndUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user_logout
/**
* @param string $user : username
* @param bool $remote : logged out remotely (so do not redirect)
* @param string $redir : url to redirect to. Uses home page according to prefs if empty
* @return void : redirects to suitable homepage or redir param if not remote
*/
function user_logout($user, $remote = false, $redir = '')
{
global $prefs, $logslib, $lslib, $user_cookie_site;
$logslib->add_log('login', 'logged out');
$userInfo = $this->get_user_info($user);
$this->delete_user_cookie($userInfo['userId']);
if ($remote && $prefs['feature_intertiki'] == 'y' and $prefs['feature_intertiki_sharedcookie'] == 'y' and !empty($prefs['feature_intertiki_mymaster'])) {
include_once('XML/RPC.php');
$remote = $prefs['interlist'][$prefs['feature_intertiki_mymaster']];
$remote['path'] = preg_replace('/^\/?/', '/', $remote['path']);
$client = new XML_RPC_Client($remote['path'], $remote['host'], $remote['port']);
$client->setDebug(0);
$msg = new XML_RPC_Message(
'intertiki.logout',
array(
new XML_RPC_Value($prefs['tiki_key'], 'string'),
new XML_RPC_Value($user, 'string')
)
);
$client->send($msg);
return;
}
// more local cleanup originally from tiki-logout.php
// go offline in Live Support
if ($prefs['feature_live_support'] == 'y') {
global $access; include_once ('lib/live_support/lslib.php');
if ($lslib->get_operator_status($user) != 'offline') {
$lslib->set_operator_status($user, 'offline');
}
}
setcookie($user_cookie_site, '', -3600, $prefs['cookie_path'], $prefs['cookie_domain']);
/* change group home page or deactivate if no page is set */
if (!empty($redir)) {
$url = $redir;
} else if (($groupHome = $this->get_group_home('Anonymous')) != '') {
$url = (preg_match('/^(\/|https?:)/', $groupHome)) ? $groupHome : 'tiki-index.php?page=' . $groupHome;
} else {
$url = $prefs['site_tikiIndex'];
}
// RFC 2616 defines that the 'Location' HTTP headerconsists of an absolute URI
if (!preg_match('/^https?\:/i', $url)) {
global $url_scheme, $url_host, $url_port, $base_url;
$url = (preg_match('#^/#', $url) ? $url_scheme . '://' . $url_host . (($url_port != '') ? ":$url_port" : '') : $base_url) . $url;
}
if (SID)
$url .= '?' . SID;
if ( $prefs['auth_method'] === 'cas' && $user !== 'admin' && $user !== '' && $prefs['cas_force_logout'] === 'y' ) {
phpCAS::logoutWithRedirectServiceAndUrl($url, $url);
}
unset($_SESSION['cas_validation_time']);
unset($_SESSION[$user_cookie_site]);
session_unset();
session_destroy();
if ($prefs['auth_method'] === 'ws') {
header('Location: ' . str_replace('//', '//admin:@', $url)); // simulate a fake login to logout the user
} else {
header('Location: ' . $url);
}
return;
}
示例2: reset
protected function reset($hard = false)
{
// Log out from the CAS server
if (phpCAS::isAuthenticated()) {
$service = "http" . (IS_SECURE ? 's' : '') . "://" . SERVER_HOST . $_SERVER['REQUEST_URI'];
phpCAS::logoutWithRedirectServiceAndUrl($service, $service);
}
return true;
}
示例3: casLogout
function casLogout()
{
global $CASAuth;
global $casIsSetUp;
global $wgUser, $wgRequest, $wgLanguageCode;
require_once $CASAuth["phpCAS"] . "/CAS.php";
// Logout from MediaWiki
$wgUser->logout();
// Get returnto value
$returnto = $wgRequest->getVal("returnto");
if ($returnto) {
$lg = Language::factory($wgLanguageCode);
$target = Title::newFromText($returnto);
if ($target && $target->getPrefixedDBkey() != $lg->specialPage("Userlogout")) {
$redirecturl = $target->getFullUrl();
}
}
if (!$casIsSetUp) {
return false;
}
// Logout from CAS (will redirect user to CAS server)
if (isset($redirecturl)) {
phpCAS::logoutWithRedirectServiceAndUrl($redirecturl, $redirecturl);
} else {
phpCAS::logout();
}
return true;
// We won't get here
}
示例4:
phpCAS::setNoCasServerValidation();
//Don't validate with SSL
$url = 'http://128.187.104.23:1337/demeter/CASLogic.php';
//Return url after validation
phpCAS::setFixedServiceURL($url);
//Set the return URL
if (isset($_REQUEST['logout'])) {
//If wanting to log out
echo "Logging Out.";
$_SESSION['AUTH'] = false;
//Make user unable to call backend functions
$_SESSION['AUTH_USER'] = '';
//Removed stored user
$url = "http://128.187.104.23:1337/demeter/index.html";
//url to return to after completion
phpCAS::logoutWithRedirectServiceAndUrl($url, '');
//set return url
} else {
$auth = phpCAS::checkAuthentication();
//Go to CAS and verify
if ($auth == false) {
//CAS failed the authentication
$_SESSION['AUTH'] = false;
//Make user unable to call backend functions
$_SESSION['AUTH_USER'] = '';
//Removed stored user
phpCAS::forceAuthentication();
//Take User to CAS sign in page
} else {
Session::put('AUTH', true);
Session::save();