Browse Source

Block D+ and D++ on special IP addresses

main
discomrade 3 years ago
parent
commit
ec917def7c
  1. 6
      inc/config.php
  2. 3
      inc/mod/pages.php

6
inc/config.php

@ -1516,6 +1516,12 @@
// Limit how many bans can be removed via the ban list. Set to false (or zero) for no limit.
$config['mod']['unban_limit'] = false;
// An array of IP addresses that throw an error when trying to D+ and D++.
// This is to prevent massively-shared IP addresses such as Tor from accidental mass deletion.
// The IP address is checked literally, not as a numerical value, so make sure it's identical
// to how that address is in code, as there are different valid ways of presenting the same address.
$config['mod']['protected_ips'] = array('127.0.0.1');
// Whether or not to lock moderator sessions to IP addresses. This makes cookie theft ineffective.
$config['mod']['lock_ip'] = true;

3
inc/mod/pages.php

@ -2496,6 +2496,9 @@ function mod_deletebyip($boardName, $post, $global = false) {
if (!$ip = $query->fetchColumn())
error($config['error']['invalidpost']);
// Prevent D+ or D++ deletion on special IP addesses, such as a Tor server
if (in_array($ip, $config['mod']['protected_ips'])) {error($ip." is listed as protected in the site config.");}
$boards = $global ? listBoards() : array(array('uri' => $boardName));
$query = '';

Loading…
Cancel
Save