diff --git a/inc/config.php b/inc/config.php index d8ae7584..5e96d097 100644 --- a/inc/config.php +++ b/inc/config.php @@ -77,6 +77,11 @@ // to the environment path (seperated by :). $config['shell_path'] = '/usr/local/bin'; + // Automatically execute some maintenance tasks when some pages are opened, which may result in higher + // latencies. + // If set to false, ensure to periodically invoke the appropriate script in the tools/ directory. + $config['auto_maintenance'] = true; + /* * ==================== * Database settings diff --git a/inc/functions.php b/inc/functions.php index b54ea7b0..436b6b2d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -876,7 +876,7 @@ function checkBan($board = false) { } foreach ($ips as $ip) { - $bans = Bans::find($_SERVER['REMOTE_ADDR'], $board, $config['show_modname'], true); + $bans = Bans::find($_SERVER['REMOTE_ADDR'], $board, $config['show_modname'], $config['auto_maintenance']); foreach ($bans as &$ban) { if ($ban['expires'] && $ban['expires'] < time()) { diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 2c2bc82e..980ccb2e 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -926,7 +926,7 @@ function mod_page_ip($ip) { $args['token'] = make_secure_link_token('ban'); if (hasPermission($config['mod']['view_ban'])) { - $args['bans'] = Bans::find($ip, false, true, true); + $args['bans'] = Bans::find($ip, false, true, $config['auto_maintenance']); } if (hasPermission($config['mod']['view_notes'])) { diff --git a/post.php b/post.php index 9c1de803..c9ab0b51 100644 --- a/post.php +++ b/post.php @@ -1673,7 +1673,7 @@ function handle_appeal() $ban_id = (int) $_POST['ban_id']; $source_ip = $_SERVER['REMOTE_ADDR']; - $ban = Bans::findSingle($_SERVER['REMOTE_ADDR'], $ban_id, $config['require_ban_view'], true); + $ban = Bans::findSingle($source_ip, $ban_id, $config['require_ban_view'], $config['auto_maintenance']); if (empty($ban)) { error($config['error']['noban']);