當前位置: 首頁>>代碼示例>>PHP>>正文


PHP phpCAS::logout方法代碼示例

本文整理匯總了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;
    }
開發者ID:rhertzog,項目名稱:lcs,代碼行數:36,代碼來源:cas_authentication.php

示例2: logout

 public function logout()
 {
     $curruser = $this->session->userdata("curruser");
     if ($curruser) {
         $this->session->sess_destroy();
     }
     phpCAS::logout();
 }
開發者ID:sdgdsffdsfff,項目名稱:stplatform,代碼行數:8,代碼來源:MY_Controller.php

示例3: index

 /**
  * Logs the user out / destroys the CAS session
  */
 public function index()
 {
     if (\phpCAS::checkAuthentication()) {
         \phpCAS::logout();
     }
     session_destroy();
     header("Location: /landing");
     return;
 }
開發者ID:byu-oit-ssengineering,項目名稱:team-managment-tool,代碼行數:12,代碼來源:logout.php

示例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;
 }
開發者ID:BackupTheBerlios,項目名稱:jasmine-svn,代碼行數:20,代碼來源:init.php

示例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);
         }
     }
 }
開發者ID:bpalme,項目名稱:osTicket-auth-cas,代碼行數:12,代碼來源:cas.php

示例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;
}
開發者ID:duanhv,項目名稱:mdg-social,代碼行數:13,代碼來源:lib.php

示例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);
     }
 }
開發者ID:rmxcc,項目名稱:pydio-core,代碼行數:15,代碼來源:class.casAuthDriver.php

示例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();
 }
開發者ID:nitroxy,項目名稱:nxauth,代碼行數:15,代碼來源:NXAuth.php

示例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();
 }
開發者ID:rajankz,項目名稱:webspace,代碼行數:23,代碼來源:CasAuthComponent+copy.php

示例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;
 }
開發者ID:emma5021,項目名稱:toba,代碼行數:16,代碼來源:toba_autenticacion_cas.php

示例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());
 }
開發者ID:duanhv,項目名稱:mdg-shop,代碼行數:45,代碼來源:logout.php

示例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).
     }
 }
開發者ID:byu-oit-appdev,項目名稱:eamWS,代碼行數:20,代碼來源:CasAuthenticate.php

示例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));
 }
開發者ID:mined-gatech,項目名稱:hubzero-cms,代碼行數:26,代碼來源:pucas.php

示例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;
 }
開發者ID:hellocc2,項目名稱:crmht,代碼行數:22,代碼來源:CheckLogin.php

示例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
	**/
開發者ID:Galinijay,項目名稱:PAS,代碼行數:31,代碼來源:main.php


注:本文中的phpCAS::logout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。