hasAuth()) { $identity = $this->getAuth()->getIdentity(); if (!empty($identity) && array_key_exists('autologinCode', $identity)) { if (count($identity) == 1) { // has only 'autologinCode' $this->authenticate(); } } } else { // $this->_initPdfUserAuthGag(); } $this->_initPdfUserAuthGag(); $this->acl = $this->_getAcl(); $this->assign('acl', $this->acl); return parent::_init(); } protected function _getAcl() { $view = new App_Acl_View(); $userId = App_User_Auth::getInstance()->hasIdentity() ? App_User_Auth::getInstance()->getData('id') : $this->getAuthData('id'); $acl = $view->getAcl($userId); return $acl; } protected function _initPdfUserAuthGag() { if (!empty($_SERVER['HTTP_X_PDF_USER_ID'])) { $auth = App_User_Auth::getInstance(); if (!$auth->isLoggedIn() && $auth->hasIdentity() && ($identity = $auth->getIdentity()) && isset($identity['xPdfUserId']) && 1 == count($identity) // has only xPdfUserId ) { $adapter = new App_User_AuthAdapter(); $adapter->setIdentity($identity); $result = $auth->authenticate($adapter); if (!$result->isValid()) { $auth->clearIdentity(); } } } return $this; } }