Select Git revision
-
Tim Steiner authoredTim Steiner authored
Action.php 1.19 KiB
<?php
/**
* A custom base controller class that takes care of setting up custom View Helpers.
*/
class App_Controller_Action extends Unl_Controller_Action
{
public function init()
{
parent::init();
$this->view->addHelperPath(dirname(__FILE__) . '/../View/Helper', 'App_View_Helper');
$this->view->doctype()->setDoctype(Zend_View_Helper_Doctype::XHTML1_TRANSITIONAL);
// Zend_Controller_Action_HelperBroker::addPrefix('App_Controller_Helper');
$this->_transparentCasLogin();
}
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();
}
}