1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

fix redirect to install

This commit is contained in:
Mzhelskiy Maxim 2014-12-01 15:19:59 +07:00
parent 9498d27c47
commit df33fe774c
2 changed files with 13 additions and 14 deletions

View file

@ -40,20 +40,6 @@ class HookMain extends Hook
*/
public function InitAction()
{
/**
* Проверяем наличие директории install
*/
if (is_dir(rtrim(Config::Get('path.application.server'),
'/') . '/install') && (!isset($_SERVER['HTTP_APP_ENV']) or $_SERVER['HTTP_APP_ENV'] != 'test')
) {
if (Config::Get('install_completed')) {
$this->Message_AddErrorSingle($this->Lang_Get('install_directory_exists'));
Router::Action('error');
} else {
Router::Location(rtrim(str_replace('index.php', '', $_SERVER['PHP_SELF']),
'/\\') . '/application/install/');
}
}
/**
* Проверка на закрытый режим
*/

View file

@ -67,3 +67,16 @@ $aRouterParams = array(/*
}
*/
);
/**
* Проверяем наличие директории install
*/
if (is_dir(rtrim(Config::Get('path.application.server'),
'/') . '/install') && (!isset($_SERVER['HTTP_APP_ENV']) or $_SERVER['HTTP_APP_ENV'] != 'test')
) {
$sUrl = rtrim(str_replace('index.php', '', $_SERVER['PHP_SELF']), '/\\') . '/application/install/';
header('Location: ' . $sUrl, true, 302);
exit();
}