Commit e3b16ea9 authored by Robert Lyon's avatar Robert Lyon

Bug 1739687: Allow non install/upgrade cli scripts to exit with message

If the site is needing install/upgrade or if the site is closed by admin

behatnotneeded

Change-Id: Ief7ebf264be7b7c3b677323f19e1468d7601d501
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 111fba57
......@@ -343,7 +343,7 @@ if (get_config('installed')) {
// If we're in the middle of an upgrade, quit the cron now.
$siteclosedforupgrade = get_config('siteclosedforupgrade');
if ($siteclosedforupgrade && defined('CRON')) {
if ($siteclosedforupgrade && (defined('CRON') || (defined('CLI') && !defined('INSTALLER')))) {
exit("Site closed for upgrade.\n");
}
......@@ -396,6 +396,9 @@ if ($siteclosedforupgrade || (get_config('siteclosedbyadmin') && !$USER->admin))
if ($USER->is_logged_in()) {
$USER->logout();
}
if (defined('CLI') && !defined('INSTALLER')) {
exit("Site closed.\n");
}
if (!defined('HOME') && !defined('INSTALLER')) {
redirect();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment