Commit fa4684ee authored by Nigel McNie's avatar Nigel McNie

Only update the siteclosed flag if it has changed. Saves a database write every page load.

parent 6ffca8f6
......@@ -327,7 +327,13 @@ function auth_setup () {
// Lock the site until core upgrades are done
require_once(get_config('libroot') . 'version.php');
set_config('siteclosed', $config->version > get_config('version'));
$siteclosed = $config->version > get_config('version');
$cfgsiteclosed = get_config('siteclosed');
if (
($siteclosed && !$cfgsiteclosed)
|| (!$siteclosed && $cfgsiteclosed)) {
set_config('siteclosed', $siteclosed);
}
// Check the time that the session is set to log out. If the user does
// not have a session, this time will be 0.
......
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