Example #1
0
 public function Init()
 {
     if ($result = parent::Init()) {
         return $result;
     }
     $this->SetDefaultEvent('info');
     $this->InitParams();
     $this->aConfig = array_merge($this->aConfig, HelperPlugin::GetConfig());
     $this->oUserCurrent = $this->PluginAceadminpanel_Admin_GetUserCurrent();
     if (!$this->User_IsAuthorization() || !$this->oUserCurrent->isAdministrator()) {
         return $this->EventDenied();
     }
     $this->oUserCurrent = $this->User_GetUserCurrent();
     $this->Viewer_Assign('ROUTE_PAGE_ADMIN', ROUTE_PAGE_ADMIN);
     $this->Viewer_Assign('sModuleVersion', $this->PluginAceadminpanel_Admin_getVersion(true));
     if (Config::Get('plugin.avalogs.admin_file') && Config::Get('plugin.avalogs.admin_enable')) {
         if (!$this->oLogs) {
             $this->oLogs = $this->Adminlogs_GetLogs();
         }
         $this->oLogs->SetLogOptions('admin', array('file' => Config::Get('plugin.avalogs.admin_file')));
         $this->aLogsMsg[] = 'user=>' . $this->oUserCurrent->GetLogin() . ', ip=>' . $_SERVER["REMOTE_ADDR"] . ', action=>' . Router::GetAction() . ', event=>' . Router::GetActionEvent() . ', path=>' . Router::GetPathWebCurrent();
     }
     if (isset($_SERVER['HTTP_REFERER'])) {
         $this->sPageRef = $_SERVER['HTTP_REFERER'];
     }
     $this->PluginSetTemplate(Router::GetActionEvent());
     $this->sMenuItemSelect = Router::GetActionEvent();
     $this->sMenuSubItemSelect = Router::GetParam(0);
     $this->aPluginInfo = array('version' => HelperPlugin::GetConfig('version'));
     $this->PluginAppendStyle('admin.css');
     $this->PluginAppendScript('admin.js');
 }
Example #2
0
 /**
  * Добавляем чекбокс для публикации в группу
  */
 public function AddCheckBox($aA)
 {
     if (LS::Adm()) {
         if ($iTopicId = Router::GetParam(0)) {
             $oTopic = $this->Topic_GetTopicById($iTopicId);
             if ($oTopic) {
                 $this->Viewer_Assign('sVkPostId', $oTopic->getExtraValue('vk_post_id'));
             }
         }
         return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__) . 'field.checkbox.tpl');
     }
     return null;
 }
 public function Init()
 {
     $this->sCurrentEvent = Router::GetActionEvent();
     if ($result = parent::Init()) {
         return $result;
     }
     if ($this->User_IsAuthorization()) {
         $this->oUserCurrent = $this->PluginAceadminpanel_Admin_GetUserCurrent();
     }
     if (!$this->oUserCurrent or !$this->oUserCurrent->isAdministrator()) {
         return $this->EventDenied();
     }
     if (!$this->oUserCurrent) {
         $this->oUserCurrent = $this->User_GetUserCurrent();
     }
     $this->Viewer_Assign('ROUTE_PAGE_ADMIN', ROUTE_PAGE_ADMIN);
     $this->Viewer_Assign('sModuleVersion', $this->PluginAceadminpanel_Admin_getVersion(true));
     $this->_InitParams();
     $this->aConfig = array_merge($this->aConfig, HelperPlugin::GetConfig());
     if (Config::Get('plugin.avalogs.admin_file') and Config::Get('plugin.avalogs.admin_enable')) {
         if (!$this->oLogs) {
             $this->oLogs = $this->Adminlogs_GetLogs();
         }
         $this->oLogs->SetLogOptions('admin', array('file' => Config::Get('plugin.avalogs.admin_file')));
         $this->aLogsMsg[] = 'user=>' . $this->oUserCurrent->GetLogin() . ', ip=>' . $_SERVER["REMOTE_ADDR"] . ', action=>' . Router::GetAction() . ', event=>' . Router::GetActionEvent() . ', path=>' . Router::GetPathWebCurrent();
     }
     $this->sPageRef = ACE::Backward('url');
     if (ACE::Backward('action') == Router::GetAction()) {
         $this->sFormAction = $this->sPageRef;
     }
     //$this->_PluginSetTemplate(Router::GetActionEvent());
     $this->sMenuItemSelect = Router::GetActionEvent();
     $this->sMenuSubItemSelect = Router::GetParam(0);
     $sVerion = HelperPlugin::GetConfig('version');
     if (!$sVerion) {
         $sVerion = ACEADMINPANEL_VERSION . '.' . ACEADMINPANEL_VERSION_BUILD;
     }
     if (preg_match('|[a-z\\-]+|i', $sVerion, $m)) {
         $sVerion = str_replace($m[0], '', $sVerion) . $m[0];
     }
     $this->aPluginInfo = array('version' => $sVerion);
     $sHtmlTitle = $this->Lang_Get('adm_title') . ' v.' . $this->PluginAceadminpanel_Admin_getVersion();
     //$this->Viewer_AddTemplateDir(HelperPlugin::GetTemplatePath(), true);
     $this->Viewer_AddHtmlTitle($sHtmlTitle);
     $this->Viewer_Assign('sAdminTitle', 'aceAdminPanel v.' . $this->PluginAceadminpanel_Admin_getVersion());
 }
Example #4
0
 /**
  * Получаем объект пользователя, чей профиль на данный момент находится на обработке
  * 
  * @return	oUser
  */
 protected function getUserForEdit()
 {
     if (!$this->oUserEdit) {
         //Получаем имя пользователя из адресной строки
         if (!($sUserLogin = Router::GetParam(1))) {
             return null;
         }
         $this->oUserEdit = $this->User_GetUserByLogin($sUserLogin);
     }
     return $this->oUserEdit;
 }