function preDispatch() { $this->_helper->layout()->setLayout('layout-final-inside'); $saveHandlerManager = new Kutu_Session_SaveHandler_Manager(); $saveHandlerManager->setSaveHandler(); Zend_Session::start(); $sReturn = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $sReturn = urlencode($sReturn); $this->view->returnTo = $sReturn; $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { $this->_redirect(KUTU_ROOT_URL . '/helper/sso/login' . '?returnTo=' . $sReturn); } else { // [TODO] else: check if user has access to admin page $username = $auth->getIdentity()->username; $this->view->username = $username; } $userId = $auth->getIdentity()->guid; $this->_userId = $userId; $tblUserFinance = new Kutu_Core_Orm_Table_UserFinance(); $this->_userInfo = $tblUserFinance->find($userId)->current(); $storeConfig = Kutu_Application::getOption('store'); $this->_configStore = $storeConfig; }
* ipso@snappymail.ca * * The latest version of phpGACL can be obtained from: * http://phpgacl.sourceforge.net/ * */ require_once dirname(__FILE__) . '/../gacl.class.php'; require_once dirname(__FILE__) . '/../gacl_api.class.php'; require_once dirname(__FILE__) . '/gacl_admin_api.class.php'; // Set Kutu environment require_once "../../../baseinit.php"; require_once 'Zend/Loader.php'; require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace('Kutu_'); $aclConfigs = Kutu_Application::getOption('resources'); Kutu_Application::getResource('session'); Zend_Session::start(); $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { //$this->_redirect(KUTU_ROOT_URL.'/helper/sso/login'.'?returnTo='.$sReturn); die('You Must Login'); } else { // [TODO] else: check if user has access to admin page $username = $auth->getIdentity()->username; $acl = Kutu_Application::getResource('acl'); if (!$acl->checkAcl("site", 'all', 'user', $username, false, false)) { die('You are not AUTHORIZED!'); } } // phpGACL Configuration file.