forked from leftypol/leftypol
Add auto_maintenance configuration option
This commit is contained in:
parent
870d3812d3
commit
bcfc934604
4 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
2
post.php
2
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']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue