Exemplo n.º 1
0
 public function RegisterHook()
 {
     if (ACE::IsMobile()) {
         return;
     }
     if (Config::Get('plugin.' . $this->sPlugin . '.skin')) {
         $this->sSkinName = Config::Get('plugin.' . $this->sPlugin . '.skin');
     }
     Config::Set('path.admin.skin', '___path.root.web___/plugins/aceadminpanel/templates/skin/admin_' . $this->sSkinName);
     $sActionEvent = Router::GetActionEvent();
     if (Router::GetAction() == 'admin') {
         if (Config::Get('plugin.aceadminpanel.compatible.default') == 'compatible') {
             $bCompatible = !in_array($sActionEvent, ACE::Str2Array(Config::Get('plugin.aceadminpanel.autonomous.events')));
         } else {
             $bCompatible = (!$sActionEvent or in_array($sActionEvent, $this->aCompatibleEvents) or in_array($sActionEvent, ACE::Str2Array(Config::Get('plugin.aceadminpanel.compatible.events'))));
         }
         if ($bCompatible) {
             $this->_preInit();
         }
     }
     $this->_checkSkinDir();
     $this->AddHook('engine_init_complete', 'EngineInitComplete', __CLASS__, 1000);
     $this->AddHook('init_action', 'InitAction', __CLASS__, 1000);
     $this->AddHook('template_html_head_end', 'HtmlHeadEnd', __CLASS__);
     $this->AddHook('template_statistics_performance_item', 'TplStatisticsPerformanceItem', __CLASS__);
     $this->AddHook('template_profile_sidebar_end', 'TplProfileSidebarEnd', __CLASS__);
 }
Exemplo n.º 2
0
 public function RegisterHook()
 {
     if (Config::Get('plugin.' . $this->sPlugin . '.skin')) {
         $this->sSkinName = Config::Get('plugin.' . $this->sPlugin . '.skin');
     }
     Config::Set('path.admin.skin', '___path.root.web___/plugins/aceadminpanel/templates/skin/admin_' . $this->sSkinName);
     $sActionEvent = Router::GetActionEvent();
     if (Router::GetAction() == 'admin') {
         if (Config::Get('plugin.aceadminpanel.compatible.default') == 'compatible') {
             $bCompatible = !in_array($sActionEvent, ACE::Str2Array(Config::Get('plugin.aceadminpanel.autonomous.events')));
         } else {
             $bCompatible = (!$sActionEvent or in_array($sActionEvent, $this->aCompatibleEvents) or in_array($sActionEvent, ACE::Str2Array(Config::Get('plugin.aceadminpanel.compatible.events'))));
         }
         if ($bCompatible) {
             $this->_preInit();
         }
     }
     $this->AddHook('engine_init_complete', 'EngineInitComplete', __CLASS__, 1000);
     $this->AddHook('init_action', 'InitAction', __CLASS__, 1000);
     $this->AddHook('template_html_head_end', 'HtmlHeadEnd', __CLASS__);
     $this->AddHook('template_body_end', 'MemoryStats', __CLASS__);
 }
 protected function EventUsersDelete($aUsersLogin = null)
 {
     $this->Security_ValidateSendForm();
     if (!$aUsersLogin) {
         $aUsersLogin = ACE::Str2Array(getRequest('adm_del_login'), ',', true);
     } else {
         $aUsersLogin = ACE::Str2Array($aUsersLogin, ',', true);
     }
     foreach ($aUsersLogin as $sUserLogin) {
         if ($sUserLogin == $this->oUserCurrent->GetLogin()) {
             $this->_messageError($this->Lang_Get('adm_cannot_del_self'), 'users:delete');
         } elseif ($oUser = $this->PluginAceadminpanel_Admin_GetUserByLogin($sUserLogin)) {
             if (mb_strtolower($sUserLogin, 'UTF-8') == 'admin') {
                 $this->_messageError($this->Lang_Get('adm_cannot_with_admin'), 'users:delete');
             } elseif ($oUser->IsAdministrator()) {
                 $this->_messageError($this->Lang_Get('adm_cannot_del_admin'), 'users:delete');
             } elseif (!getRequest('adm_user_del_confirm') and !getRequest('adm_bulk_confirm')) {
                 $this->_messageError($this->Lang_Get('adm_cannot_del_confirm'), 'users:delete');
             } else {
                 $this->PluginAceadminpanel_Admin_DelUser($oUser->GetId());
                 $this->_messageNotice($this->Lang_Get('adm_user_deleted', array('user' => $sUserLogin ? $sUserLogin : '')), 'users:delete');
             }
         } else {
             $this->_messageError($this->Lang_Get('adm_user_not_found', array('user' => $sUserLogin ? $sUserLogin : '')), 'users:delete');
         }
     }
     return true;
 }