Ejemplo n.º 1
0
 /**
  * Получение токена в админке
  */
 protected function EventGetAccessToken()
 {
     if (!LS::Adm()) {
         return parent::EventNotFound();
     }
     $this->SetTemplateAction('access_token');
 }
Ejemplo n.º 2
0
 public function __construct($oEngin, $sAction)
 {
     parent::__construct($oEngin, $sAction);
     $this->Viewer_Assign('tpl_content', '');
     $this->Viewer_Assign('tpl_include', '');
     if ($this->User_IsAuthorization()) {
         $this->oUserCurrent = $this->User_GetUserCurrent();
     }
 }
 /**
  * Получает список параметров из URL с нужным смещением
  *
  * @return array
  */
 public function GetParams()
 {
     $aParams = parent::GetParams();
     $aResult = array();
     for ($i = $this->nParamsOffset; $i < sizeof($aParams); $i++) {
         $aResult[] = $aParams[$i];
     }
     return $aResult;
 }
Ejemplo n.º 4
0
 protected function EventMakeAdm()
 {
     if (!$this->User_IsAuthorization()) {
         return parent::EventNotFound();
     }
     if (!$this->User_GetUserCurrent()->isAdministrator()) {
         return parent::EventNotFound();
     }
     $aPair = $this->PluginAdm_Admalgoritm_getPair();
     Router::Location('admin');
 }
 protected function EventSubscriptionNewsUnsubscribe()
 {
     if (!($sString = $this->GetParamEventMatch(1, 0))) {
         return parent::EventNotFound();
     }
     $sString = str_replace(array('{', '}'), array('/', '+'), $sString);
     $sHash = substr($sString, 0, 10);
     require_once Config::Get('path.root.engine') . '/lib/external/XXTEA/encrypt.php';
     $sMail = xxtea_decrypt(base64_decode(substr($sString, 10)), $sHash);
     if (!($oSubscription = $this->PluginSubscription_Subscription_GetSubscriptionByMail($sMail, null, $sHash))) {
         return parent::EventNotFound();
     }
     $oSubscription->setUnsubscribeDate(date("Y-m-d H:i:s"));
     if (!$this->PluginSubscription_Subscription_UpdateSubscription($oSubscription)) {
         return parent::EventNotFound();
     }
     $this->SetTemplateAction('news_unsubscribe');
 }
Ejemplo n.º 6
0
 /**
  * Админка
  */
 public function EventAdmin()
 {
     if (!LS::Adm()) {
         return parent::EventNotFound();
     }
     $this->sMenuItemSelect = 'admin';
     $this->_addTitle($this->Lang_Get('plugin.forum.acp'));
     /**
      * Подключаем CSS
      */
     $this->Viewer_AppendStyle(Plugin::GetTemplatePath(__CLASS__) . 'css/admin.css');
     /**
      * Подключаем JS
      */
     $this->Viewer_AppendScript(Plugin::GetWebPath(__CLASS__) . 'templates/framework/js/forum.admin.js');
     $sCategory = $this->GetParam(0);
     $sAction = $this->GetParam(1);
     /**
      * Раздел админки
      */
     switch ($sCategory) {
         /**
          * Управление форумами
          */
         case 'forums':
             /**
              * Раздел
              */
             switch ($sAction) {
                 /**
                  * Новый форум
                  */
                 case 'new':
                     $this->_adminForumForm('new');
                     break;
                     /**
                      * Редактирование форума
                      */
                 /**
                  * Редактирование форума
                  */
                 case 'edit':
                     $this->_adminForumForm('edit');
                     break;
                     /**
                      * Удаление форума
                      */
                 /**
                  * Удаление форума
                  */
                 case 'delete':
                     $this->_adminForumDelete();
                     break;
                     /**
                      * Изменение сортировки
                      */
                 /**
                  * Изменение сортировки
                  */
                 case 'sort':
                     $this->_adminForumSort();
                     break;
                     /**
                      * Права доступа
                      */
                 /**
                  * Права доступа
                  */
                 case 'perms':
                     $this->_adminForumPerms();
                     break;
                     /**
                      * Пересчет счетчиков
                      */
                 /**
                  * Пересчет счетчиков
                  */
                 case 'refresh':
                     $this->_adminForumRefresh();
                     break;
                     /**
                      * Список форумов
                      */
                 /**
                  * Список форумов
                  */
                 case null:
                     $this->_adminForums();
                     break;
                 default:
                     return parent::EventNotFound();
             }
             $this->sMenuSubItemSelect = 'forums';
             break;
             /**
              * Пользователи
              */
         /**
          * Пользователи
          */
         case 'users':
             $this->_adminUsers();
             break;
             /**
              * Права доступа
              */
         /**
          * Права доступа
          */
         case 'perms':
             $this->_adminPerms();
             break;
             /**
              * Файлы
              */
         /**
          * Файлы
          */
         case 'files':
             $this->_adminFiles();
             break;
             /**
              * Главная
              */
         /**
          * Главная
          */
         case null:
             $this->_adminMain();
             break;
         default:
             return parent::EventNotFound();
     }
 }
 /**
  * Удаление записи
  */
 protected function EventDelete()
 {
     $this->Security_ValidateSendForm();
     /**
      * Получаем ID записи и проверяем существует ли она
      */
     if (!($oTestimonial = $this->PluginTestimonials_Testimonials_GetTestimonialsById($this->GetParam(0)))) {
         return parent::EventNotFound();
     }
     /**
      * проверяем есть ли право на удаление записи
      */
     if (!$this->PluginTestimonials_ACL_IsAllowDeleteTestimonial($oTestimonial, $this->oUserCurrent)) {
         return parent::EventNotFound();
     }
     /**
      * Удаляем запись
      */
     if ($this->PluginTestimonials_Testimonials_DeleteTestimonial($oTestimonial)) {
         Router::Location(Router::GetPath('testimonials'));
     } else {
         $this->Message_AddError($this->Lang_Get('system_error'));
     }
 }