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

Don't try to do CAS auth if the unl_sso cookie isn't set.

parent 9f157cc7
No related branches found
No related tags found
No related merge requests found
......@@ -18,23 +18,13 @@ class App_Controller_Action extends Unl_Controller_Action
protected function _transparentCasLogin()
{
$session = new Zend_Session_Namespace(__CLASS__);
if (!array_key_exists('unl_sso', $_COOKIE)) {
// 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.
if (get_class($this) == 'Auth_IndexController') {
return;
}
Auth_UserModel::authenticateUser();
if (array_key_exists('unl_sso', $_COOKIE) || Zend_Auth::getInstance()->hasIdentity()) {
Auth_UserModel::authenticateUser();
}
}
}
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