/** * @return Gio_Core_Acl */ public static function getIntance() { if (null == self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
public function __construct($blocks = array()) { $this->setBlocks($blocks); $configs = Gio_Core_Config_Xml::getConfig(); /** * Not installed GioCMS */ if (!Gio_Core_Application::_initInstallChecker()) { $request = Gio_Core_Request::getInstance(); $configs->server->static = $request->getBaseUrl(); $configs->server->resource = $request->getBaseUrl(); $configs->web->url = $request->getBaseUrl(); } $this->APP_STATIC_SERVER = (string) $configs->server->static; $this->APP_RESOURCE_SERVER = (string) $configs->server->resource; $this->APP_WEB_URL = (string) $configs->web->url; $this->APP_WEB_NAME = (string) $configs->web->name; $this->APP_TEMPLATE = (string) $configs->web->template; $this->APP_SKIN = (string) $configs->web->skin; $this->APP_META_KEYWORD = (string) $configs->web->meta->keyword; $this->APP_META_DESCRIPTION = (string) $configs->web->meta->description; $defaultLanguage = (string) $configs->web->language; //$lang = Gio_Core_Request::getInstance()->getParam('lang'); //$this->APP_LANG = ($lang && $defaultLanguage != $lang) ? $lang : $defaultLanguage; $this->APP_LANG = $defaultLanguage; $routes = Gio_Core_Route::getInstance(); $this->routes = $routes; $string = Gio_Core_String::getInstance(); $this->STRING = $string; $translator = new Gio_Core_Translator(); $this->TRANSLATOR = $translator; if (Gio_Core_Application::_initInstallChecker() == true) { $acl = Gio_Core_Acl::getIntance(); $this->ACL = $acl; } $messenger = Gio_Core_Messenger::getInstance(); $this->MESSENGER = $messenger; if (Gio_Core_Application::_initInstallChecker()) { $user = Gio_Core_Session::getUser(); $this->USER = $user; } /** * JSON */ $json = new Services_JSON(); $this->JSON = $json; $this->CONFIG = $configs; }
public function run() { $controller = Gio_Core_Controller::getIntance(); $view = Gio_Core_View::getInstance(); $configs = Gio_Core_Config_Xml::getConfig('web'); if ($view->APP_TEMPLATE != (string) $configs->admin->template) { return; } $moduleId = $controller->getModuleName(); /** * Check Module Installed */ if ($moduleId != $this->_coreModule && null == Modules_Core_Services_Module::getById($moduleId)) { Modules_Core_Services_Exception::error('PERMISSION_DENY'); return; } $ruleChecker = Gio_Core_Acl::getIntance(); $actionId = $controller->getActionName(); $controllerId = $controller->getControllerName(); if ($ruleChecker->isAllowed($actionId, $controllerId, $moduleId) === false) { Modules_Core_Services_Exception::error('PERMISSION_DENY'); } }