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

Update CAS auth adapter to support single sign out.

parent b09428ff
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,13 @@ class App_Controller_Action extends Unl_Controller_Action
$session = new Zend_Session_Namespace(__CLASS__);
if (!array_key_exists('unl_sso', $_COOKIE)) {
return;
// Only passively check for a login once per hour (per user)
if ($session->lastCasCheck > time() - 60*60) {
return;
}
$session->lastCasCheck = time();
} else {
$session->lastCasCheck = 0;
}
// The auth module is doing its thing (probably an active login or logout). Let it be.
......@@ -29,12 +35,6 @@ class App_Controller_Action extends Unl_Controller_Action
return;
}
// Only passively check for a login once per hour (per user)
if ($session->lastCasCheck > time() - 60*60) {
return;
}
$session->lastCasCheck = time();
// Do a passive authentication check
......@@ -55,6 +55,9 @@ class App_Controller_Action extends Unl_Controller_Action
$casAdapter = new Unl_Auth_Adapter_Cas($serviceUrl, 'https://login.unl.edu/cas', $this->_getParam('ticket'));
$casAdapter->setGateway();
$this->_redirect($casAdapter->getLoginUrl());
if ($casAdapter->isTicketExpired()) {
$this->_redirect($casAdapter->getLoginUrl());
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment