This method is used to logout from CAS. Halts by redirecting to the CAS
server.
public static logoutWithUrl ( string $url ) : void | ||
$url | string | a URL that will be transmitted to the CAS server |
return | void |
/** * Logout the user form the current symfony application and from the * CAS server * @param boolean $onlyLocal Set it to true, to logout from the application, but stay login in the CAS */ public function logout($url = null, $onlyLocal = false) { parent::signOut(); $this->username = null; if (!$onlyLocal) { sfCAS::initPhpCAS(); if (!empty($url)) { phpCAS::logoutWithUrl($url); } else { phpCas::logout(); } } }
public function logout() { $logout_redirect_url = getConfig('casldap_logout_redirect_url'); $_SESSION['adminloggedin'] = ""; $_SESSION['logindetails'] = ""; //destroy the session session_destroy(); if (!getConfig('cas_disable_logout')) { self::init_cas_client(); phpCAS::logoutWithUrl($logout_redirect_url); } header("Location: {$logout_redirect_url}"); exit; }
function deconnexion_CAS($url = "") { // import de la librairie CAS include LIBRARY_PATH . 'CAS/CAS.php'; // import des parametres du serveur CAS $config_CAS_host = $_SESSION['config']['CAS_host']; $config_CAS_portNumber = $_SESSION['config']['CAS_portNumber']; $config_CAS_URI = $_SESSION['config']['CAS_URI']; global $connexionCAS; // initialisation phpCAS if ($connexionCAS != "active") { $CASCnx = phpCAS::client(CAS_VERSION_2_0, $config_CAS_host, $config_CAS_portNumber, $config_CAS_URI); $connexionCAS = "active"; } phpCAS::logoutWithUrl($url); }
die; } // include path library include_once get_path('incRepositorySys') . '/lib/thirdparty/cas/CAS.php'; // DB table definition $tbl_mdb_names = claro_sql_get_main_tbl(); $tbl_user = $tbl_mdb_names['user']; if (!isset($_SESSION['init_CasCheckinDone']) || $logout || basename($_SERVER['SCRIPT_NAME']) == 'login.php' && isset($_REQUEST['authModeReq']) && $_REQUEST['authModeReq'] == 'CAS' || isset($_REQUEST['fromCasServer'])) { phpCAS::client(CAS_VERSION_2_0, get_conf('claro_CasServerHostUrl'), get_conf('claro_CasServerHostPort', 443), get_conf('claro_CasServerRoot', ''), FALSE); phpCAS::setNoCasServerValidation(); if ($logout) { $userLoggedOnCas = false; $logout_url = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . get_conf('urlAppend') . '/index.php'; if (get_conf('claro_CasGlobalLogout')) { if (phpCAS::checkAuthentication()) { phpCAS::logoutWithUrl($logout_url); } } else { claro_redirect($logout_url); die; } } elseif (basename($_SERVER['SCRIPT_NAME']) == 'login.php') { // set the call back url if (isset($_REQUEST['sourceUrl'])) { $casCallBackUrl = base64_decode($_REQUEST['sourceUrl']); } else { $casCallBackUrl = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . get_conf('urlAppend') . '/'; } $casCallBackUrl .= (strstr($casCallBackUrl, '?') ? '&' : '?') . 'fromCasServer=true'; if ($_SESSION['_cid']) { $casCallBackUrl .= (strstr($casCallBackUrl, '?') ? '&' : '?') . 'cidReq=' . urlencode($_SESSION['_cid']);