public function routeStartup(Zend_Controller_Request_Abstract $request) { if (Zetta_Acl::getInstance()->isAllowed('admin_module_zfdebuginit') && Zetta_Acl::getInstance()->isAllowed('admin')) { $this->_view->renderWidget(MODULES_PATH . DS . 'Zfdebuginit/App/views', 'admin/widget.phtml', array('enabled' => $this->_isEnable)); $this->_view->headScript()->appendFile($this->_view->libUrl('/Zfdebuginit/public/js/admin.js')); } }
public function routeStartup(Zend_Controller_Request_Abstract $request) { if (Zetta_Acl::getInstance()->isAllowed('admin')) { $this->_view->renderWidget(MODULES_PATH . DS . 'Accessusers/App/views', 'admin/widget.phtml', array('user' => Zend_Auth::getInstance()->getIdentity())); $this->_view->headLink()->appendStylesheet($this->_view->libUrl('/Accessusers/public/css/admin.css')); } }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_search')) { throw new Exception('Access Denied'); } $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->initContext(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_service')) { throw new Exception('Access Denied'); } $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('disable', 'json')->addActionContext('enable', 'json')->addActionContext('update', 'json')->addActionContext('restore', 'json')->initContext(); }
protected function _registerPlugins() { Zend_Controller_Front::getInstance()->registerPlugin(new Modules_Seo_Plugin_Seo()); if (Zetta_Acl::getInstance()->isAllowed('admin_module_seo')) { Zend_Controller_Front::getInstance()->registerPlugin(new Modules_Seo_Plugin_Widget()); } }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_menu')) { throw new Exception('Access Denied'); } $this->_modelMenu = new Modules_Menu_Model_Menu(); $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('tree', 'html')->addActionContext('add', 'html')->addActionContext('addsection', 'html')->addActionContext('delete', 'json')->addActionContext('deletesection', 'json')->addActionContext('savetree', 'json')->initContext(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_blocks')) { throw new Exception('Access Denied'); } $this->_modelBlocks = new Modules_Blocks_Model_Blocks(); $this->_helper->getHelper('AjaxContext')->addActionContext('save', 'json')->addActionContext('blockinfo', 'json')->addActionContext('blockdelete', 'json')->initContext(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_router')) { throw new Exception('Access Denied'); } $this->_modelRoutes = Modules_Router_Model_Router::getInstance(); $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('add', 'html')->addActionContext('savetree', 'json')->addActionContext('delete', 'json')->addActionContext('getmoduleactions', 'json')->initContext(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_filemanager')) { throw new Exception('Access Denied'); } $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_dbmigrations')) { throw new Exception('Access Denied'); } $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('info', 'html')->initContext(); $this->_manager = new Modules_Dbmigrations_Framework_Manager(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_guitestcase')) { throw new Exception('Access Denied'); } $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('run', 'html')->addActionContext('runall', 'html')->initContext(); $this->_testCases = Modules_Guitestcase_Framework_Manager::getInstance()->getTestCaseClasses(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_filemanager')) { throw new Exception('Access Denied'); } $this->_model = Modules_Settings_Model_Settings::getInstance(); $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('add', 'html')->addActionContext('delete', 'json')->initContext(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_cron')) { throw new Exception('Access Denied'); } $this->_model = new Modules_Cron_Model_Cron(); $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('add', 'html')->addActionContext('delete', 'json')->addActionContext('run', 'json')->addActionContext('stop', 'json')->initContext(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin')) { throw new Exception('Access Denied'); } $this->_helper->getHelper('AjaxContext')->addActionContext('managepanel', 'html')->addActionContext('favoriteslist', 'html')->initContext(); $this->_user = Zend_auth::getInstance()->getIdentity(); $this->_model = new Modules_Admin_Model_Panel(); }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_logger')) { throw new Exception('Access Denied'); } $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('clear', 'html')->initContext(); $loggerConfig = new Zend_Config_Ini(SYSTEM_PATH . '/Configs/_log.ini', ZETTA_MODE); $this->_logFilePath = $loggerConfig->resources->log->stream->writerParams->stream; }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_seo')) { throw new Exception('Access Denied'); } $this->view->currentUrl = $this->getParam('currentUrl'); $this->_model = new Modules_Seo_Model_Seo(); $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->initContext(); }
public function __construct() { $this->_view = Zend_Registry::get('view'); if (array_key_exists('z_blocks_enabled', $_COOKIE) && true == $_COOKIE['z_blocks_enabled']) { $this->_isEnable = true; } if (Zetta_Acl::getInstance()->isAllowed('admin_module_blocks')) { $this->_isAccess = true; } }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_analytics')) { throw new Exception('Access Denied'); } $this->_model = Modules_Settings_Model_Settings::getInstance(); $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->initContext(); $this->_googleID = Zend_Registry::get('SiteConfig')->google_analytics_id; $this->_googleEmail = Zend_Registry::get('SiteConfig')->google_email ? Zend_Registry::get('SiteConfig')->google_email : '*****@*****.**'; $this->_googlePassword = Zend_Registry::get('SiteConfig')->google_password ? Zend_Registry::get('SiteConfig')->google_password : '******'; }
public function init() { if (false == Zetta_Acl::getInstance()->isAllowed('admin_module_publications')) { throw new Exception('Access Denied'); } $this->_modelList = new Modules_Publications_Model_List(); $this->_modelFields = new Modules_Publications_Model_Fields(); $this->_helper->getHelper('AjaxContext')->addActionContext('index', 'html')->addActionContext('add', 'html')->addActionContext('delete', 'json')->addActionContext('fields', 'html')->addActionContext('routes', 'html')->addActionContext('addfield', 'html')->addActionContext('sortfields', 'json')->addActionContext('deletefield', 'json')->addActionContext('view', 'html')->addActionContext('sortpublications', 'json')->addActionContext('addpublication', 'html')->addActionContext('deletepublication', 'json')->initContext(); if ($rubric_id = $this->getParam('rubric_id')) { $this->_rubric = $this->view->rubric = $this->_modelList->getRubricInfo($rubric_id); $this->_modelPublications = new Modules_Publications_Model_Table($this->view->rubric->table_name); } }
public function addAction() { if ($roleInfo = $this->hasParam('role_id')) { $roleInfo = $this->view->role = $this->_modelRoles->getRole($this->getParam('role_id')); } $form = new Zetta_Form(Zend_Registry::get('config')->Accessusers->form->admin_adduser); $rolesElement = $form->getElement('role_name'); $rolesElement->addMultiOptions(Zetta_Acl::getInstance()->getAccepdedRolesHash()); if (is_object($roleInfo)) { $rolesElement->setValue($roleInfo->name); } if ($user_id = $this->getParam('login')) { $this->view->user_id = $user_id; $editUserData = $this->_modelUsers->getUser($user_id); $form->setDefaults($editUserData->toArray()); $form->getElement('username')->setAttrib('disabled', 'disabled'); $form->getElement('password')->setRequired(false); $form->getElement('re_password')->setRequired(false); $myUser = Zend_Auth::getInstance()->getIdentity(); if ($myUser->username == $user_id) { $form->removeElement('role_name'); } } else { $saltElement = $form->getElement('salt'); $saltElement->setValue(Modules_Access_Model_Users::GenerateSalt()); } if (!sizeof($_POST) || !$form->isValid($_POST)) { $this->view->form = $form; } else { $arrayData = array('salt' => $form->getValue('salt'), 'active' => (int) $form->getValue('active'), 'email' => $form->getValue('email'), 'name' => $form->getValue('name'), 'sername' => $form->getValue('sername')); if ($form->getValue('role_name')) { $arrayData['role_name'] = $form->getValue('role_name'); } if ($form->getValue('password')) { $arrayData['password'] = md5(Zend_Registry::get('config')->Db->staticSalt . md5($form->getValue('password')) . $form->getValue('salt')); if ($this->getParam('login') == Modules_Access_Framework_User::getInstance()->getUserName()) { $stdObject = Zend_Auth::getInstance()->getStorage()->read(); $stdObject->password = $arrayData['password']; Zend_Auth::getInstance()->getStorage()->write($stdObject); } } if ($user_id) { $this->_modelUsers->update($arrayData, $this->_modelUsers->getAdapter()->quoteInto('username = ?', $user_id)); } else { $arrayData['username'] = $form->getValue('username'); $this->_modelUsers->insert($arrayData); } $this->renderScript('admin/addComplete.ajax.phtml'); } }
public function bootstrap() { parent::bootstrap(); if (!System_Functions::tableExist('admin_panel_favorites')) { $_migrationManager = new Modules_Dbmigrations_Framework_Manager(); $_migrationManager->upTo('Modules_Admin_Migrations_CreatePanelFavoritesTable'); } if (Zend_Controller_Front::getInstance()->getRequest()->isXmlHttpRequest()) { return false; } /* регистрируем плагин вывода панели администрирования на frontend */ if (Zetta_Acl::getInstance()->isAllowed('admin')) { Zend_Controller_Front::getInstance()->registerPlugin(new Modules_Admin_Plugin_Panel()); } }
public function init() { $this->_modelRoutes = Modules_Router_Model_Router::getInstance(); $this->_currentSection = $this->_modelRoutes->current(); $this->_helper->viewRenderer->setNoRender(); $this->view->current_route = $this->_currentSection; if ($this->_currentSection) { Zend_Registry::set('current_route', (object) $this->_currentSection); } $this->view->headTitle($this->_currentSection['name']); if (!$this->_currentSection || 1 == $this->_currentSection['disable'] || !Zetta_Acl::getInstance()->isAllowed('route_' . $this->_currentSection['route_id'], 'allow')) { return $this->_forwardTo404(); } $this->_forwardToMVC(); }
protected function _findModules() { $moduleInfoFiles = (array) glob(MODULES_PATH . '/*/info.ini') + (array) glob(HEAP_PATH . '/*/info.ini'); sort($moduleInfoFiles); $return = array(); $returnDeveloper = array(); foreach ($moduleInfoFiles as $row) { $config = new Zend_Config_Ini($row); preg_match('|.*/(.*)/info.ini$|i', $row, $matches); /* регистрируем плагин вывода панели администрирования на frontend */ if (Zetta_Acl::getInstance()->isAllowed('admin_module_' . System_String::StrToLower($matches[1]), 'deny')) { if (false == $config->developer) { $return[] = array_merge($config->toArray(), array('module' => $matches[1])); } else { $returnDeveloper[] = array_merge($config->toArray(), array('module' => $matches[1])); } } } return array($return, $returnDeveloper); }
public function __construct($config = array(), $definition = null) { parent::__construct($config, $definition); $this->_acceptedRoles = array_keys(Zetta_Acl::getInstance()->getAccepdedRolesHash()); }
protected function _access() { return Zetta_Acl::getInstance()->isAllowed('admin_module_blocks'); }
public function rulesbyroleAction() { $role_id = $this->getParam('role_id'); if (sizeof($_POST)) { $this->_modelRules->removeRoleRules($role_id); foreach ($_POST as $resource_name => $access) { if ($resource_name == 'role_id') { continue; } switch ($access) { case 'allow': $this->_modelRules->addRule($resource_name, $role_id, 'allow'); break; case 'deny': $this->_modelRules->addRule($resource_name, $role_id, 'deny'); break; } } Zetta_Acl::resetInstance(); } $this->view->role_name = $role_id; $this->view->resources = $this->_modelResources->getResources(Zetta_Acl::getInstance()->getMyGroup()); }