コード例 #1
0
ファイル: Admin.php プロジェクト: bokultis/kardiomedika
 public function init()
 {
     //set timeout
     $this->_sessionAdmin = new Zend_Session_Namespace(Zend_Auth_Storage_Session::NAMESPACE_DEFAULT);
     $this->_sessionAdmin->setExpirationSeconds(30 * 60);
     //load acl
     $aclLoader = HCMS_Acl_Loader::getInstance();
     $aclLoader->load();
     if (!Zend_Auth::getInstance()->hasIdentity()) {
         $this->_admin = null;
     } else {
         $this->_admin = Zend_Auth::getInstance()->getIdentity();
         $aclLoader->setCurrentRoleCode($aclLoader->getRoleCode($this->_admin->get_role_id()));
     }
     $this->view->admin = $this->_admin;
     if ($this->_checkAuth) {
         $this->_checkAuthorization();
     }
     $this->_redirect_to_ssl();
     $this->_checkIP();
     //set ACL object for Zend_Navigation
     Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl($aclLoader->getAcl());
     Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole($aclLoader->getCurrentRoleCode());
     $this->_initVersionInfo();
     $this->_module = new Application_Model_Module();
     if (Application_Model_ModuleMapper::getInstance()->findByCode($this->getRequest()->getModuleName(), $this->_module)) {
         $this->view->moduleSettings = $this->_module->get_settings();
     }
     parent::init();
 }