2012-02-05 18:49:28 +02:00
|
|
|
<?php
|
2014-10-08 08:20:29 +03:00
|
|
|
/*
|
|
|
|
* LiveStreet CMS
|
|
|
|
* Copyright © 2013 OOO "ЛС-СОФТ"
|
|
|
|
*
|
|
|
|
* ------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Official site: www.livestreetcms.com
|
|
|
|
* Contact e-mail: office@livestreetcms.com
|
|
|
|
*
|
|
|
|
* GNU General Public License, version 2:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
*
|
|
|
|
* ------------------------------------------------------
|
|
|
|
*
|
|
|
|
* @link http://www.livestreetcms.com
|
|
|
|
* @copyright 2013 OOO "ЛС-СОФТ"
|
|
|
|
* @author Maxim Mzhelskiy <rus.engine@gmail.com>
|
|
|
|
*
|
|
|
|
*/
|
2012-02-05 18:49:28 +02:00
|
|
|
|
|
|
|
/**
|
2012-05-04 13:45:34 +03:00
|
|
|
* Регистрация основных хуков
|
2012-02-05 18:49:28 +02:00
|
|
|
*
|
2014-10-08 08:20:29 +03:00
|
|
|
* @package application.hooks
|
2012-05-04 13:45:34 +03:00
|
|
|
* @since 1.0
|
2012-02-05 18:49:28 +02:00
|
|
|
*/
|
2014-10-08 11:49:34 +03:00
|
|
|
class HookMain extends Hook
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Регистрируем хуки
|
|
|
|
*/
|
|
|
|
public function RegisterHook()
|
|
|
|
{
|
|
|
|
$this->AddHook('init_action', 'InitAction', __CLASS__, 1000);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Обработка хука инициализации экшенов
|
|
|
|
*/
|
|
|
|
public function InitAction()
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Проверка на закрытый режим
|
|
|
|
*/
|
|
|
|
$oUserCurrent = $this->User_GetUserCurrent();
|
2014-10-20 14:40:04 +03:00
|
|
|
if (!$oUserCurrent and Config::Get('general.close') and !Router::CheckIsCurrentAction((array)Config::Get('general.close_exceptions'))) {
|
|
|
|
Router::Action('login');
|
2014-10-08 11:49:34 +03:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Запуск обработки сборщика
|
|
|
|
*/
|
|
|
|
$this->Ls_SenderRun();
|
|
|
|
}
|
2014-05-28 08:37:30 +03:00
|
|
|
}
|