public function dispatch() { $result = \CMSAuth::getInstance()->check(); if ($result) { $controller = new HtmlRouteController($this->filePath, $this->request); $controller->main(); } }
public function dispatch() { $granted = \CMSAuth::getInstance()->check(); if ($granted) { parent::dispatch(); } else { } }
public function __construct() { if (empty(self::$instance)) { self::$instance = $this; } $this->extractAuthDataFromPost(); $this->autoLogin(); }
public function testForInjections() { if (\UsersLogin::isLogined()) { if (\CMSAuth::getInstance()->isAdmin(\UsersLogin::getCurrentSession())) { return; } } foreach ($this->data as $key => $value) { self::validateParameter($key, $value); } $this->validateParameter('Current page url', $this->uri()); }
public function main() { $auth = CMSAuth::getInstance(); $design = CMSDesign::getInstance(); $strings = CMS_Strings::getInstance(); $aData = $this->config->load($this->path); $aGenerated = $this->config->generate($aData); $aBegin = $this->aBegin; $szTitle = $this->szTitle; // $aTabSheet = $this->generateTabSheetContent($aData, $aGenerated); $aTabSheet[] = array('id' => 'tab_sitemap', 'title' => 'Свойства'); $design->begin($aBegin, $szTitle); $design->documentBegin(); $design->header($szTitle); if (!empty($this->aButton)) { $design->buttons($this->aButton); } $this->outputComment(); $design->formBegin(); $design->submit('submit', $strings->getMessage('APPLY')); $design->tabSheetBegin($aTabSheet); foreach ($aTabSheet as $key => $row) { // Если это не последняя вкладка, выводим из нее контент if ($key != sizeof($aTabSheet) - 1) { $design->tabContentBegin($aTabSheet[$key]['id']); $design->tableBegin(); foreach ($row['item'] as $item) { $design->row2cell($item['title'], $item['value']); } $design->tableEnd(); $design->tabContentEnd(); } else { SitemapCMSForms::outputSitemapTabSheet($this->aSitemap, $aTabSheet[$key]['id'], array('Путь к конфигу' => $this->path)); } } $design->tabSheetEnd(); $design->submit('submit', $strings->getMessage('APPLY')); $design->formEnd(); $design->documentEnd(); $design->End(); $this->output(); }
public function __construct() { // $auth = CMSAuth::getInstance(); if (!$auth->isSuperAdmin(UsersLogin::getCurrentSession())) { $this->addError('Access denied'); $this->jump(\Extasy\CMS::getDashboardWWWRoot()); } parent::__construct(); // Вызов формы редактирования $this->addGet('id', 'showEdit'); // Вызов формы добавления $this->addGet('add', 'showAdd'); // Вызов функции редактирования $this->addPost('id,login,password,rights', 'postEdit'); $this->addPost('id,login,password', 'postEdit'); // Вызов функции добавления $this->addPost('login,password,rights', 'postAdd'); $this->addPost('login,password', 'postAdd'); // Удаление $this->addPost('id', 'delete'); }
protected function initAdministrativeMenu() { $auth = \CMSAuth::getInstance(); if ($auth->isSuperAdmin(\UsersLogin::getCurrentUser())) { $this->view->set('showAdministrativeMenu', true); } }
/** * Отображает форму редактирования */ protected function outputEditingForm($sheets, $controls) { $sheetsEmpty = false; if (empty($sheets)) { $sheetsEmpty = true; $sheets = array(array('id' => 'mainTab', 'title' => 'Ошибка')); } if ($this->schema->getSitemapLink()) { $sitemapInfo = Sitemap_Sample::get($this->schema->getSitemapLink()); array_push($sheets, array('id' => 'sitemapTab', 'title' => 'Свойства')); } // $design = CMSDesign::getInstance(); $design->forms->begin(); // Вывод вкладок $design->tabs->sheetsBegin($sheets); // По вкладкам вывод $i = 0; if (!empty($controls)) { foreach ($controls as $list) { $design->tabs->contentBegin($sheets[$i]['id']); $design->table->begin(); foreach ($list as $control) { $design->table->row2cell($control->getTitle(), $control->outputInForm()); } $design->table->end(); $design->tabs->contentEnd(); $i++; } } else { $design->tabs->contentBegin($sheets[0]['id']); $design->decor->contentBegin(); printf('У данной схемы пока нету вкладок для редактирования<br/>'); $auth = CMSAuth::getInstance(); if ($auth->isSuperAdmin(UsersLogin::getCurrentUser())) { printf('Перейти к <a href="%scconfig/manage.php?schema=%s&edit=1">управлению</a> конфигом', \Extasy\CMS::getDashboardWWWRoot(), $this->schema->getName()); } $design->decor->contentEnd(); $design->tabs->contentEnd(); } if (!empty($sitemapInfo)) { $auth = CMSAuth::getInstance(); if ($auth->isSuperAdmin(UsersLogin::getCurrentUser())) { $link = sprintf('<a href="%scconfig/manage.php?schema=%s" target="_blank">Управление конфигом</a>', \Extasy\CMS::getDashboardWWWRoot(), $this->schema->getName()); $property = array('' => $link); } else { $property = array(); } SitemapCMSForms::outputSitemapTabSheet($sitemapInfo, $sheets[sizeof($sheets) - 1]['id'], $property); } $design->tabs->sheetsEnd(); $design->forms->hidden('schema', $this->schema->getName()); // Вывод конца $design->forms->submit('submit', 'Сохранить'); $design->forms->end(); $this->outputFooter(); }
}), array('url' => 'administrate/create_section.php', 'controller' => 'SitemapCreateSectionPage', 'action' => 'process'), array('url' => 'administrate/manage_document.php', 'controller' => 'ManageDocumentAdminPage', 'action' => 'process'), array('url' => 'administrate/php_console.php', 'controller' => 'PhpConsole', 'action' => 'process'), array('url' => 'administrate/regedit.php', 'controller' => 'SystemRegisterAdministrate', 'action' => 'process'), array('url' => 'administrate/setup_events.php', 'controller' => 'RegisterSetupEvents', 'action' => 'process'), array('url' => 'administrate/sql.php', 'controller' => 'AdminSqlConsole', 'action' => 'process'), array('url' => 'administrate/template-manager.php', 'controller' => '\\Extasy\\sitemap\\controller\\TemplateManager', 'action' => 'process'), array('url' => 'administrate/schedule', 'controller' => '\\Extasy\\Schedule\\ScheduleDashboard', 'action' => 'process'), array('url' => 'cconfig/index.php', 'controller' => 'CConfigAdminIndexPage', 'action' => 'process'), array('url' => 'cconfig/edit.php', 'controller' => 'CConfigAdminEditPage', 'action' => 'process'), array('url' => 'cconfig/manage.php', 'controller' => 'CConfigAdminManagePage', 'action' => 'process'), array('url' => 'email/config.php', 'controller' => 'Email_Admin_Config', 'action' => 'process'), array('url' => 'email/index.php', 'controller' => 'Email_Admin_Index', 'action' => 'process'), array('url' => 'email/logs.php', 'controller' => 'Email_Logs_Admin', 'action' => 'process'), array('url' => 'list/edit.php', 'controller' => 'CMS_DataManage', 'action' => 'process'), array('url' => 'list/index.php', 'controller' => 'CMS_Page_DataList', 'action' => 'process'), array('url' => 'list/order.php', 'controller' => 'Extasy\\kernel\\cms\\_pages\\ListOrder', 'action' => 'process'), array('url' => 'sitemap/aliases.php', 'controller' => 'SitemapAliasesAdmin', 'action' => 'process'), array('url' => 'sitemap/edit.php', 'controller' => 'SiteMap_Controller_Edit', 'action' => 'process', 'name' => 'dashboard.sitemap.manage'), array('url' => 'sitemap/get-parents.php', 'controller' => 'Sitemap_Controller_GetParents', 'action' => 'process'), array('url' => 'sitemap/getinformation.php', 'controller' => 'SiteMap_Controller_Information', 'action' => 'process'), array('url' => 'sitemap/go-additional.php', 'controller' => 'SiteMap_Controller_Additional', 'action' => 'process'), array('url' => 'sitemap/move.php', 'controller' => 'Sitemap_MoveController', 'action' => 'process'), array('url' => 'sitemap/order.php', 'controller' => 'SiteMap_Controller_Order', 'action' => 'process'), array('url' => 'sitemap/page-list.php', 'controller' => '\\Extasy\\sitemap\\controller\\Children', 'action' => 'process'), array('url' => 'sitemap/search.php', 'controller' => 'Sitemap_Controller_Search', 'action' => 'process'), array('url' => 'sitemap/standart-add.php', 'controller' => 'SitemapStandartAddPage', 'action' => 'process'), array('url' => 'columns/tags.php', 'controller' => '\\Extasy\\Columns\\Controllers\\Tags', 'action' => 'process'), array('url' => 'columns/htmlarea.php', 'controller' => '\\Extasy\\Columns\\Controllers\\Htmlarea', 'action' => 'process'), array('url' => 'users/group_permissions/', 'controller' => '\\Extasy\\Users\\admin\\GroupPermissions', 'action' => 'process'), array('url' => 'users/forgot_password/email.php', 'callback' => function () { \Extasy\Users\forgot\Dashboard\EmailConfig::startup(); }), array('url' => 'users/forgot_password/new_password_email.php', 'callback' => function () { \Extasy\Users\forgot\Dashboard\EmailConfig::startup(); }), array('url' => 'users/forgot_password/index', 'callback' => function () { \Extasy\Users\forgot\Dashboard\PageConfig::startup(); }), array('url' => 'users/login/index', 'callback' => function () { \Extasy\Users\login\Dashboard\PageConfig::startup(); }), array('url' => 'users/profile/index', 'callback' => function () { \Extasy\Users\profile\Dashboard\PageConfig::startup(); }), array('url' => 'users/profile/DeleteProfileEmailConfig.php', 'callback' => function () { $page = new \Extasy\Users\profile\Dashboard\DeleteProfileEmailConfig(); $page->process(); }), array('url' => 'users/profile/UpdateEmailConfig.php', 'controller' => '\\Extasy\\Users\\admin\\UpdateEmailConfig', 'action' => 'process'), array('url' => 'users/profile/UpdatePassword', 'controller' => '\\Extasy\\Users\\admin\\UpdatePasswordConfig', 'action' => 'process'), array('url' => 'users/registration/confirm.php', 'controller' => 'Users_Admin_Index', 'action' => 'process'), array('url' => 'users/registration/email.php', 'controller' => '\\Extasy\\Users\\registration\\Dashboard\\Email', 'action' => 'process'), array('url' => 'users/registration/email-confirmation.php', 'controller' => '\\Extasy\\Users\\registration\\Dashboard\\EmailConfirmation', 'action' => 'process'), array('url' => 'users/registration/index', 'callback' => function () { RegistrationPageConfig::startUp(); }), array('url' => 'users/registration/success.php', 'controller' => '\\Extasy\\Users\\registration\\Dashboard\\Success', 'action' => 'process'), array('url' => 'users/index.php', 'controller' => 'Users_Admin_Index', 'action' => 'process'), array('url' => 'users/manage', 'controller' => '\\Extasy\\Users\\admin\\AccountDashboard', 'action' => 'process', 'name' => 'dashboard.users.manage'), array('url' => 'users/search', 'controller' => 'Users_Admin_Search', 'action' => 'process'), array('url' => 'logout.php', 'callback' => function () { $auth = \CMSAuth::getInstance(); $auth->unAuthorize('/'); })); $prefix = $this->getDashboardWWWRoot(); foreach ($map as $row) { $row['url'] = $prefix . $row['url']; $route = new DashboardRoute($row); $this->dispatcher->addRoute($route); } $loginRouteConfig = array('url' => $prefix . '$', 'controller' => '\\Extasy\\Dashboard\\Controllers\\Index', 'action' => 'showLoginForm'); $this->dispatcher->addRoute(new HttpRoute($loginRouteConfig)); $routes = [['url' => 'http://Service/testFiles', 'controller' => '\\Extasy\\Service\\Validator', 'action' => 'testFiles'], ['url' => 'http://Service/fixture', 'controller' => '\\Extasy\\Service\\Fixture', 'action' => 'setUp'], ['url' => 'http://Service/csv', 'controller' => '\\Extasy\\Service\\Validator', 'action' => 'csv'], ['url' => 'http://Service/models/createTable/:modelName', 'controller' => '\\Extasy\\Service\\Models', 'action' => 'createTable']]; foreach ($routes as $route) { $this->dispatcher->addRoute(new HttpRoute($route)); }
protected function outputDebugResults() { $this->loadSystemConfig(); $value = intval($this->systemConfig->enable_debug->value); if ($value) { if (CMSAuth::getInstance()->isLogined()) { Trace::setDisabled(false); $this->insertIntoResponse(Trace::finish()); } } }
/** * * Enter description here ... */ protected static function outputDocumentInfo($id, $name) { $auth = CMSAuth::getInstance(); $add2title = ''; $design = CMSDesign::getInstance(); $design->row2cell('Документ ', $name . $add2title); $design->row2cell('Индекс', $id); }