Skip to content
Snippets Groups Projects
Commit 1fd623b4 authored by Tim Steiner's avatar Tim Steiner
Browse files

Handle CAS logouts.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@72 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 3a670f18
Branches
Tags
No related merge requests found
...@@ -5,13 +5,16 @@ function unl_cas_init() ...@@ -5,13 +5,16 @@ function unl_cas_init()
require_once dirname(__FILE__) . '/lib/CAS/CAS.php'; require_once dirname(__FILE__) . '/lib/CAS/CAS.php';
phpCAS::client(CAS_VERSION_2_0,'login.unl.edu',443,'/cas'); phpCAS::client(CAS_VERSION_2_0,'login.unl.edu',443,'/cas');
phpCAS::setNoCasServerValidation(); phpCAS::setNoCasServerValidation();
phpCAS::handleLogoutRequests();
if (!array_key_exists('last_sso_check', $_SESSION)) { if (!array_key_exists('last_sso_check', $_SESSION)) {
$_SESSION['unl']['last_sso_check'] = 0; $_SESSION['unl']['last_sso_check'] = 0;
} }
$auth = FALSE;
if (array_key_exists('unl_sso', $_COOKIE)) { if (array_key_exists('unl_sso', $_COOKIE)) {
$auth = phpCAS::checkAuthentication(); $auth = phpCAS::checkAuthentication();
}
if ($auth) { if ($auth) {
$username = phpCAS::getUser(); $username = phpCAS::getUser();
$user = user_load_by_name($username); $user = user_load_by_name($username);
...@@ -22,7 +25,9 @@ function unl_cas_init() ...@@ -22,7 +25,9 @@ function unl_cas_init()
$GLOBALS['user'] = $user; $GLOBALS['user'] = $user;
user_login_finalize(); user_login_finalize();
} }
} } else if (!user_is_anonymous()) {
$GLOBALS['user'] = drupal_anonymous_user();
user_login_finalize();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment