2012-02-05 18:49:28 +02:00
|
|
|
<?php
|
|
|
|
/*-------------------------------------------------------
|
|
|
|
*
|
|
|
|
* LiveStreet Engine Social Networking
|
|
|
|
* Copyright © 2008 Mzhelskiy Maxim
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Official site: www.livestreet.ru
|
|
|
|
* Contact e-mail: rus.engine@gmail.com
|
|
|
|
*
|
|
|
|
* GNU General Public License, version 2:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
*
|
|
|
|
---------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2012-05-04 13:45:34 +03:00
|
|
|
* Регистрация основных хуков
|
2012-02-05 18:49:28 +02:00
|
|
|
*
|
2012-05-04 13:45:34 +03:00
|
|
|
* @package hooks
|
|
|
|
* @since 1.0
|
2012-02-05 18:49:28 +02:00
|
|
|
*/
|
|
|
|
class HookMain extends Hook {
|
2012-05-04 13:45:34 +03:00
|
|
|
/**
|
|
|
|
* Регистрируем хуки
|
|
|
|
*/
|
2012-02-05 18:49:28 +02:00
|
|
|
public function RegisterHook() {
|
|
|
|
$this->AddHook('init_action','InitAction',__CLASS__,1000);
|
|
|
|
}
|
2012-05-04 13:45:34 +03:00
|
|
|
/**
|
|
|
|
* Обработка хука инициализации экшенов
|
|
|
|
*/
|
2012-02-05 18:49:28 +02:00
|
|
|
public function InitAction() {
|
|
|
|
/**
|
|
|
|
* Проверяем наличие директории install
|
|
|
|
*/
|
2013-08-09 07:25:40 +03:00
|
|
|
if(is_dir(rtrim(Config::Get('path.root.server'),'/').'/install') && (!isset($_SERVER['HTTP_APP_ENV']) or $_SERVER['HTTP_APP_ENV']!='test')){
|
2012-02-05 18:49:28 +02:00
|
|
|
$this->Message_AddErrorSingle($this->Lang_Get('install_directory_exists'));
|
|
|
|
Router::Action('error');
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Проверка на закрытый режим
|
|
|
|
*/
|
|
|
|
$oUserCurrent=$this->User_GetUserCurrent();
|
|
|
|
if (!$oUserCurrent and Config::Get('general.close') and Router::GetAction()!='registration' and Router::GetAction()!='login') {
|
|
|
|
Router::Action('login');
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Запуск обработки сборщика
|
|
|
|
*/
|
|
|
|
$this->Ls_SenderRun();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|