本文整理匯總了PHP中phpCAS::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpCAS::logout方法的具體用法?PHP phpCAS::logout怎麽用?PHP phpCAS::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpCAS
的用法示例。
在下文中一共展示了phpCAS::logout方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: startup
/**
* Handle plugin-specific actions
* These actions are handled at the startup hook rather than registered as
* custom actions because the user session does not necessarily exist when
* these actions need to be handled.
*
* @param array $args arguments from rcmail
* @return array modified arguments
*/
function startup($args) {
// intercept PGT callback action
if ($args['action'] == 'pgtcallback') {
// initialize CAS client
$this->cas_init();
// retrieve and store PGT if present
phpCAS::forceAuthentication();
// end script
exit;
}
// intercept CAS logout action
else if ($args['action'] == 'caslogout') {
// initialize CAS client
$this->cas_init();
// logout from CAS server
phpCAS::logout();
// end script
exit;
}
$args['valid'] = true;
return $args;
}
示例2: logout
public function logout()
{
$curruser = $this->session->userdata("curruser");
if ($curruser) {
$this->session->sess_destroy();
}
phpCAS::logout();
}
示例3: index
/**
* Logs the user out / destroys the CAS session
*/
public function index()
{
if (\phpCAS::checkAuthentication()) {
\phpCAS::logout();
}
session_destroy();
header("Location: /landing");
return;
}
示例4: disconnect
/**
* This method disconnects the user.
*
* Notice that the CAS server actually needs to be notified of the
* disconnection, so we use phpCAS's relevant function.
*
* @returns Nothing ! This method should always redirect to the main
* page.
*/
function disconnect()
{
// Load the CAS module
include_once 'CAS/CAS.php';
// Start CAS, and use it to disconnect
phpCAS::client(CAS_VERSION_2_0, $this->casServerHostname, $this->casServerPort, $this->casServerURI);
phpCAS::logout("http://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"]);
// Really ? Well, should not be ever executed, because phpCAS::logout()
// redirects to another page, or exit()s the php script if failure.
return true;
}
示例5: signOut
public static function signOut($config, $return_url = null)
{
self::buildClient($config->get('cas-hostname'), $config->get('cas-port'), $config->get('cas-context'));
unset($_SESSION[':cas']);
if ($config->get('cas-single-sign-off')) {
if (empty($return_url)) {
phpCAS::logout();
} else {
phpCAS::logoutWithRedirectService($return_url);
}
}
}
示例6: logoutCAS
function logoutCAS($config, $wwwroot)
{
require_once dirname(__FILE__) . '/CAS/CAS.php';
// get module configuration
$cas_validate = true;
$cas_version = CAS_VERSION_2_0;
$cas_language = 'english';
phpCAS::client($cas_version, $config->cashostname, (int) $config->casport, $config->casbaseuri, false);
error_log("CAS: Logout");
phpCAS::logout($wwwroot);
error_log("CAS: Logout Exit");
return true;
}
示例7: preLogUser
public function preLogUser($sessionId)
{
if ($_GET['get_action'] == "logout") {
phpCAS::logout();
return;
}
phpCAS::forceAuthentication();
$cas_user = phpCAS::getUser();
if (!$this->userExists($cas_user) && $this->autoCreateUser()) {
$this->createUser($cas_user, openssl_random_pseudo_bytes(20));
}
if ($this->userExists($cas_user)) {
AuthService::logUser($cas_user, "", true);
}
}
示例8: logout
public static function logout($return_uri = "")
{
$options = "";
/* default value in phpCAS */
$host = (!empty($_SERVER['HTTPS']) ? "https://" : "http://" . $_SERVER['HTTP_HOST']) . '/';
if (strpos($return_uri, "http") === 0) {
$host = "";
}
if ($return_uri !== null) {
$return_uri = trim($return_uri, '/');
$options = array('service' => "{$host}{$return_uri}");
}
phpCAS::logout($options);
NXAPI::clear_cache();
}
示例9: logout
/**
* Logout execution method. Initializes CAS client and force logout if required before returning to parent logout method.
*
* @param mixed $url Optional URL to redirect the user to after logout
* @return string AuthComponent::$loginAction
* @see AuthComponent::$loginAction
* @access public
*/
function logout()
{
// Set debug mode
phpCAS::setDebug(false);
//Initialize phpCAS
phpCAS::client(CAS_VERSION_2_0, Configure::read('CAS.hostname'), Configure::read('CAS.port'), Configure::read('CAS.uri'), true);
// No SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// Force CAS logout if required
if (phpCAS::isAuthenticated()) {
phpCAS::logout(array('url' => 'http://www.cakephp.org'));
// Provide login url for your application
}
return parent::logout();
}
示例10: logout
function logout()
{
if ($this->uso_login_basico() && $this->permite_login_toba()) {
//Si es login toba no redirecciono al servidor CAS
$this->eliminar_marca_login(self::$marca_login_basico);
return;
}
if ($this->uso_login_centralizado()) {
$this->eliminar_marca_login(self::$marca_login_central);
}
// Se conecta al CAS
$this->instanciar_cliente_cas();
// Desloguea sin parametros porque igualmente CAS pide cerrar el browser por cuestiones de seguridad
phpCAS::logout();
exit;
}
示例11: index
public function index()
{
if ($this->customer->isLogged()) {
$this->customer->logout();
$this->cart->clear();
unset($this->session->data['wishlist']);
unset($this->session->data['shipping_address_id']);
unset($this->session->data['shipping_country_id']);
unset($this->session->data['shipping_zone_id']);
unset($this->session->data['shipping_postcode']);
unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['payment_address_id']);
unset($this->session->data['payment_country_id']);
unset($this->session->data['payment_zone_id']);
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
unset($this->session->data['comment']);
unset($this->session->data['order_id']);
unset($this->session->data['coupon']);
unset($this->session->data['reward']);
unset($this->session->data['voucher']);
unset($this->session->data['vouchers']);
phpCAS::client(CAS_VERSION_2_0, CAS_HOST, CAS_PORT, CAS_CONTEXT);
phpCAS::logout();
$this->redirect($this->url->link('account/logout', '', 'SSL'));
}
$this->language->load('account/logout');
$this->document->setTitle($this->language->get('heading_title'));
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
$this->data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'), 'separator' => $this->language->get('text_separator'));
$this->data['breadcrumbs'][] = array('text' => $this->language->get('text_logout'), 'href' => $this->url->link('account/logout', '', 'SSL'), 'separator' => $this->language->get('text_separator'));
$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['text_message'] = $this->language->get('text_message');
$this->data['button_continue'] = $this->language->get('button_continue');
$this->data['continue'] = $this->url->link('common/home');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/success.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/success.tpl';
} else {
$this->template = 'default/template/common/success.tpl';
}
$this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
$this->response->setOutput($this->render());
}
示例12: logout
public function logout($user)
{
if (phpCAS::isAuthenticated()) {
//Step 1. When the client clicks logout, this will run.
// phpCAS::logout will redirect the client to the CAS server.
// The CAS server will, in turn, redirect the client back to
// this same logout URL.
//
// phpCAS will stop script execution after it sends the redirect
// header, which is a problem because CakePHP still thinks the
// user is logged in. See Step 2.
$current_url = Router::url(null, true);
phpCAS::logout(array('url' => $current_url));
} else {
//Step 2. This will run when the CAS server has redirected the client
// back to us. Do nothing in this method, then after this method
// returns CakePHP will do whatever is necessary to log the user
// out from its end (destroying the session or whatever).
}
}
示例13: logout
/**
* Actions to perform when logging out a user session
*
* @return void
*/
public function logout()
{
if (Config::get('debug')) {
$debug_location = $this->params->get('debug_location', '/var/log/apache2/php/phpCAS.log');
phpCAS::setDebug($debug_location);
}
$this->initialize();
$service = rtrim(Request::base(), '/');
if (empty($service)) {
$service = $_SERVER['HTTP_HOST'];
}
$return = '';
if ($return = Request::getVar('return', '', 'method', 'base64')) {
$return = base64_decode($return);
if (!JURI::isInternal($return)) {
$return = '';
}
$return = '/' . ltrim($return, '/');
}
phpCAS::logout(array('service' => $service . $return, 'url' => $service . $return));
}
示例14: sso
public static function sso($action = 'login')
{
include_once ROOT_PATH . 'lib/cas/CAS.php';
include_once ROOT_PATH . 'config/cas.php';
$client = '';
// error_reporting(E_ALL);
// ini_set("display_errors", 1);
$cas_host = CAS_HOST;
$cas_port = intval(CAS_PORT);
$cas_context = CAS_CONTEXT;
$phpCAS = new \phpCAS();
// $phpCAS->setDebug();
$phpCAS->client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
$phpCAS->setNoCasServerValidation();
$phpCAS->handleLogoutRequests();
$phpCAS->forceAuthentication();
if (isset($action) && $action == 'logout') {
$phpCAS->logout();
}
$client = $phpCAS->getAttributes();
return $client;
}
示例15: serialize
$test = phpCAS::checkAuthentication();
// Récupération des données utilisateur
$sql = 'SELECT * FROM user WHERE nbEtudiant = :nbEtu LIMIT 1';
$res = $db->prepare($sql);
$res->execute(array('nbEtu' => phpCAS::getUser()));
if ($res_f = $res->fetch()) {
$_SESSION['id'] = $res_f['id'];
$_SESSION['nom'] = $res_f['nom'];
$_SESSION['prenom'] = $res_f['prenom'];
$_SESSION['rang'] = $res_f['rang'];
if (isset($res_f['promotion'])) {
$_SESSION['promotion'] = $res_f['promotion'];
}
} else {
$errorCode = serialize(array(32 => true));
phpCAS::logout(array('service' => ROOT . 'index.php?erreur=' . $errorCode));
}
}
// On revérifie l'état de la connexion
if ($currentPageData['fullRight'][$_SESSION['rang']] == 0) {
$errorCode = serialize(array(7 => true));
header('Location: ' . ROOT . 'index.php?erreur=' . $errorCode);
}
}
} else {
$errorCode = serialize(array(7 => true));
header('Location: ' . ROOT . 'index.php?erreur=' . $errorCode);
}
/**
Connexion au nom d'un autre utilisateur
**/