mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 01:10:51 +01:00
config.php: add auto_maintenance configuration option
This commit is contained in:
parent
36476f6341
commit
75714505a0
@ -92,6 +92,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 tools/maintenance.php script.
|
||||
$config['auto_maintenance'] = true;
|
||||
|
||||
/*
|
||||
* ====================
|
||||
* Database settings
|
||||
|
@ -876,7 +876,7 @@ function checkBan($board = false) {
|
||||
}
|
||||
|
||||
foreach ($ips as $ip) {
|
||||
$bans = Bans::find($ip, $board, $config['show_modname'], null, true);
|
||||
$bans = Bans::find($ip, $board, $config['show_modname'], null, $config['auto_maintenance']);
|
||||
|
||||
foreach ($bans as &$ban) {
|
||||
if ($ban['expires'] && $ban['expires'] < time()) {
|
||||
|
@ -897,7 +897,7 @@ function mod_page_ip($cip) {
|
||||
$args['token'] = make_secure_link_token('ban');
|
||||
|
||||
if (hasPermission($config['mod']['view_ban'])) {
|
||||
$args['bans'] = Bans::find($ip, false, true, null, true);
|
||||
$args['bans'] = Bans::find($ip, false, true, null, $config['auto_maintenance']);
|
||||
}
|
||||
|
||||
if (hasPermission($config['mod']['view_notes'])) {
|
||||
@ -927,7 +927,7 @@ function mod_edit_ban($ban_id) {
|
||||
if (!hasPermission($config['mod']['edit_ban']))
|
||||
error($config['error']['noaccess']);
|
||||
|
||||
$args['bans'] = Bans::find(null, false, true, $ban_id, true);
|
||||
$args['bans'] = Bans::find(null, false, true, $ban_id, $config['auto_maintenance']);
|
||||
$args['ban_id'] = $ban_id;
|
||||
$args['boards'] = listBoards();
|
||||
$args['current_board'] = isset($args['bans'][0]['board']) ? $args['bans'][0]['board'] : false;
|
||||
|
2
post.php
2
post.php
@ -1439,7 +1439,7 @@ if (isset($_POST['delete'])) {
|
||||
|
||||
$ban_id = (int)$_POST['ban_id'];
|
||||
|
||||
$ban = Bans::findSingle($_SERVER['REMOTE_ADDR'], $ban_id, $config['require_ban_view'], true);
|
||||
$ban = Bans::findSingle($_SERVER['REMOTE_ADDR'], $ban_id, $config['require_ban_view'], $config['auto_maintenance']);
|
||||
|
||||
if (empty($ban)) {
|
||||
error($config['error']['noban']);
|
||||
|
Loading…
Reference in New Issue
Block a user