1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-22 02:38:18 +03:00

Поддержка принудительного https для экшенов #361

This commit is contained in:
Mzhelskiy Maxim 2014-10-20 18:40:04 +07:00
parent cb07c6303c
commit 08fde6cad8
3 changed files with 5 additions and 26 deletions

View file

@ -58,31 +58,8 @@ class HookMain extends Hook
* Проверка на закрытый режим
*/
$oUserCurrent = $this->User_GetUserCurrent();
if (!$oUserCurrent and Config::Get('general.close')) {
$bAllow = false;
$aExceptions = (array)Config::Get('general.close_exceptions');
foreach ($aExceptions as $mKey => $sAction) {
if (is_int($mKey)) {
$aEvents = array();
} else {
$aEvents = $sAction;
$sAction = $mKey;
}
if (Router::GetAction() == $sAction) {
if ($aEvents) {
if (in_array(Router::GetActionEvent(), $aEvents)) {
$bAllow = true;
break;
}
} else {
$bAllow = true;
break;
}
}
}
if (!$bAllow) {
Router::Action('login');
}
if (!$oUserCurrent and Config::Get('general.close') and !Router::CheckIsCurrentAction((array)Config::Get('general.close_exceptions'))) {
Router::Action('login');
}
/**
* Запуск обработки сборщика

View file

@ -383,6 +383,8 @@ $config['router']['config']['default']['event'] = null;
$config['router']['config']['default']['params'] = null;
$config['router']['config']['default']['request'] = null;
$config['router']['config']['action_not_found'] = 'error';
// Принудительное использование https для экшенов. Например, 'login' и 'registration'
$config['router']['force_secure'] = array();
/**
* Настройки вывода блоков

@ -1 +1 @@
Subproject commit 945a0ebea0ffb8fdb2ab1600bbe6bd52eee835b8
Subproject commit 211d3ddd2e62de4446ce8e63adafa725d73b6b71