Exemplo n.º 1
0
 /**
  * Инициализация
  *
  */
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
     /**
      * Проверяем есть ли у юзера сессия, т.е. залогинен или нет
      */
     $sUserId = $this->Session_Get('user_id');
     if ($sUserId and $oUser = $this->GetUserById($sUserId) and $oUser->getActivate()) {
         if ($this->oSession = $this->GetSessionByUserId($oUser->getId())) {
             /**
              * Сюда можно вставить условие на проверку айпишника сессии
              */
             $this->oUserCurrent = $oUser;
         }
     }
     /**
      * Запускаем автозалогинивание
      * В куках стоит время на сколько запоминать юзера
      */
     $this->AutoLogin();
     $this->oMapper->SetUserCurrent($this->oUserCurrent);
     /**
      * Обновляем сессию
      */
     if (isset($this->oSession)) {
         $this->UpdateSession();
     }
 }
Exemplo n.º 2
0
 /**
  * Инициализация модуля
  * Создаём локальный экземпляр модуля Viewer
  * Момент довольно спорный, но позволяет избавить основной шаблон от мусора уведомлений
  *
  */
 public function Init()
 {
     $this->oViewerLocal = $this->Viewer_GetLocalViewer();
     $this->oMapper = Engine::GetMapper(__CLASS__);
     $this->sDir = Config::Get('module.notify.dir');
     $this->sPrefix = Config::Get('module.notify.prefix');
 }
 /**
  * Инициализация модуля. Это обязательный метод
  */
 public function Init()
 {
     /**
      * Создаем объект маппера PluginExample_ModuleExample_MapperExample
      */
     $this->oMapper = Engine::GetMapper(__CLASS__);
 }
Exemplo n.º 4
0
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
     //get me my DB link baby
     $this->oUserCurrent = $this->User_GetUserCurrent();
     //do I need this?
 }
Exemplo n.º 5
0
 /**
  * Инициализация модуля
  * Создаём локальный экземпляр модуля Viewer
  * Момент довольно спорный, но позволяет избавить основной шаблон от мусора уведомлений
  *
  */
 public function Init()
 {
     if (!class_exists('ModuleViewer')) {
         require_once Config::Get('path.root.engine') . "/modules/viewer/Viewer.class.php";
     }
     $this->oViewerLocal = $this->Viewer_GetLocalViewer();
     $this->oMapper = Engine::GetMapper(__CLASS__);
 }
Exemplo n.º 6
0
 public function Init()
 {
     parent::Init();
     //init all parent stuff
     $this->oMapperTopic = Engine::GetMapper('PluginMystuff_ModuleTopic');
     //this is essential, otherwise the default mapper is used, which we do not want
     $this->oMapperTopic->SetUserCurrent(PluginLib_ModuleUser::GetUserCurrent());
 }
Exemplo n.º 7
0
 /**
  * Initialization
  *
  * @return void
  */
 public function Init()
 {
     $this->_oMapper = Engine::GetMapper(__CLASS__);
     $this->_aPlaceNames[0] = $this->Lang_Get('banneroid_total');
     $this->_aPlaceNames[1] = $this->Lang_Get('banneroid_under_article');
     $this->_aPlaceNames[2] = $this->Lang_Get('banneroid_side_bar');
     $this->_aPlaceNames[3] = $this->Lang_Get('banneroid_body_begin');
     $this->_aPlaceNames[4] = $this->Lang_Get('banneroid_body_end');
 }
Exemplo n.º 8
0
 /**
  * Инициализация
  *
  */
 public function Init()
 {
     $this->oMapperTopic = Engine::GetMapper(__CLASS__);
     $this->oUserCurrent = $this->User_GetUserCurrent();
     $aTopicTypeItems = $this->GetTopicTypeItems(array('state' => self::TOPIC_TYPE_STATE_ACTIVE));
     foreach ($aTopicTypeItems as $oTypeItem) {
         $this->aTopicTypes[$oTypeItem->getCode()] = $oTypeItem;
     }
 }
Exemplo n.º 9
0
 /**
  * Инициализация модуля
  */
 public function Init()
 {
     parent::Init();
     /**
      * Получаем текущего пользователя
      */
     $this->oUserCurrent = $this->User_GetUserCurrent();
     /**
      * Получаем объект маппера
      */
     $this->oMapperForum = Engine::GetMapper(__CLASS__);
 }
Exemplo n.º 10
0
 public function Init()
 {
     parent::Init();
     $this->oMapper = Engine::GetMapper(__CLASS__);
     /**
      * Получаем типы из БД и активируем их
      */
     if ($aTargetItems = $this->GetTargetItemsByFilter(array('state' => self::TARGET_STATE_ACTIVE))) {
         foreach ($aTargetItems as $oTarget) {
             $this->Property_AddTargetType($oTarget->getType(), $oTarget->getParams());
         }
     }
 }
Exemplo n.º 11
0
 /**
  * Инициализация
  *
  */
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
     /**
      * Проверяем есть ли у юзера сессия, т.е. залогинен или нет
      */
     $sUserId = $this->Session_Get('user_id');
     $sSessionKey = $this->Session_Get('session_key');
     if ($sUserId and $oUser = $this->GetUserById($sUserId) and $oUser->getActivate()) {
         /**
          * Проверяем сессию
          */
         if ($oSession = $oUser->getSession()) {
             $bSessionValid = false;
             /**
              * Т.к. у пользователя может быть несколько сессий (разные браузеры), то нужно дополнительно сверить
              */
             if ($oSession->getKey() == $sSessionKey and $oSession->isActive()) {
                 $bSessionValid = true;
             } else {
                 /**
                  * Пробуем скорректировать сессию
                  */
                 if ($oSession = $this->oMapper->GetSessionByKey($sSessionKey) and $oSession->getUserId() == $oUser->getId() and $oSession->isActive()) {
                     $bSessionValid = true;
                     $oUser->setSession($oSession);
                 }
             }
             if ($bSessionValid) {
                 /**
                  * Сюда можно вставить условие на проверку айпишника сессии
                  */
                 $this->oUserCurrent = $oUser;
                 $this->oSession = $oSession;
             }
         }
     }
     /**
      * Запускаем автозалогинивание
      * В куках стоит время на сколько запоминать юзера
      */
     $this->AutoLogin();
     /**
      * Обновляем сессию
      */
     if (isset($this->oSession)) {
         $this->UpdateSession();
     }
 }
Exemplo n.º 12
0
 /**
  * Инициализация
  */
 public function Init()
 {
     // Маппер
     $this->oMapper = Engine::GetMapper(__CLASS__);
     // facebook API
     $path = Plugin::GetPath('facebook') . 'classes/lib/facebook-php-sdk/src/facebook.php';
     include $path;
     $this->LoadSettings();
     $this->aCfg = Config::Get('plugin.facebook');
     // Игнорировать сертификаты
     Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;
     Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;
     // API
     if ($this->aCfg['application']['id'] && $this->aCfg['application']['secret']) {
         $this->FB = new Facebook(array('appId' => $this->aCfg['application']['id'], 'secret' => $this->aCfg['application']['secret'], 'cookie' => true));
     }
 }
Exemplo n.º 13
0
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
     $sShortNow = date('d.m');
     $sShortStart = Config::Get('plugin.adm.date.start');
     $sShortStop = Config::Get('plugin.adm.date.stop');
     /*
      * Если текущая дата больше даты окончания, но меньше даты старта,
      * то плагин в данный момент выключен
      */
     if ($this->compareShortDateToInt($sShortNow, $sShortStop) == 1 && $this->compareShortDateToInt($sShortNow, $sShortStart) == -1) {
         $this->isEnable = false;
     } else {
         $this->isEnable = true;
         if ($this->compareShortDateToInt($sShortNow, $sShortStart) == 1) {
             /* конец текущего года */
             $this->year = date('Y') + 1;
         } else {
             /* начало следующего года */
             $this->year = date('Y');
         }
     }
 }
Exemplo n.º 14
0
 /**
  * Настройка
  */
 protected function Setup()
 {
     $this->oMapperStorage = Engine::GetMapper(__CLASS__);
 }
Exemplo n.º 15
0
 /**
  * Инициализация
  *
  */
 public function Init()
 {
     $this->oMapperTopic = Engine::GetMapper(__CLASS__);
     $this->oUserCurrent = $this->User_GetUserCurrent();
 }
Exemplo n.º 16
0
 /**
  * Возвращает объект маппера
  * @see Engine::GetMapper
  *
  * @param $sClassName Класс модуля маппера
  * @param string|null $sName Имя маппера
  * @param DbSimple_Mysql|null $oConnect Объект коннекта к БД
  * @return mixed
  */
 public static function Mpr($sClassName, $sName = null, $oConnect = null)
 {
     return Engine::GetMapper($sClassName, $sName, $oConnect);
 }
Exemplo n.º 17
0
 /**
  * Инициализация модуля
  * Создаём локальный экземпляр модуля Viewer
  * Момент довольно спорный, но позволяет избавить основной шаблон от мусора уведомлений
  *
  */
 public function Init()
 {
     $this->oViewerLocal = $this->Viewer_GetLocalViewer();
     $this->oMapper = Engine::GetMapper(__CLASS__);
 }
Exemplo n.º 18
0
 public function Init()
 {
     parent::Init();
     $this->oMapper = Engine::GetMapper(__CLASS__);
 }
Exemplo n.º 19
0
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
     $this->sVersionDB = $this->oMapper->GetAdminValue('version');
 }
Exemplo n.º 20
0
 /**
  * Инициализация модуля
  */
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
     $this->hLog = @fopen(Config::Get('path.root.server') . '/logs/' . Config::Get('sys.logs.profiler_file'), 'r+');
 }
Exemplo n.º 21
0
 /**
  * Инициализация
  *
  */
 public function Init()
 {
     $this->oMapperBlog = Engine::GetMapper(__CLASS__);
     $this->oMapperBlog->SetUserCurrent($this->User_GetUserCurrent());
     $this->oUserCurrent = $this->User_GetUserCurrent();
 }
Exemplo n.º 22
0
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
     $this->oMapperTalk = Engine::GetMapper('ModuleTalk');
 }
Exemplo n.º 23
0
 public function Init()
 {
     $this->oMapper = Engine::GetMapper(__CLASS__);
 }
Exemplo n.º 24
0
 public function init()
 {
     $conn = $this->Database_GetConnect(Config::Get('plugin.coverage.abills'));
     $this->oMapper = Engine::GetMapper(__CLASS__, 'Abills', $conn);
 }