Fix ips + antiwipe mode config

This commit is contained in:
0chan 2023-02-09 18:57:58 +06:00
parent 74dd1bc1d1
commit 90d2a29f0c
2 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,7 @@ class Posting {
function __construct() {
global $tc_db, $board_class;
$this->ipless_mode = (I0_IPLESS_MODE=='true' || (I0_IPLESS_MODE=='auto' && $_SERVER['REMOTE_ADDR']=='127.0.0.1'));
$this->ipless_mode = (I0_IPLESS_MODE=='true' || (I0_IPLESS_MODE=='auto' && I0_USER_IP =='127.0.0.1'));
// Set user ID
$this->is_new_user = false;
@ -45,7 +45,7 @@ class Posting {
$this->user_id = $user_id_trunc;
}
else {
$this->user_id = $_SERVER['REMOTE_ADDR'];
$this->user_id = I0_USER_IP;
}
$this->user_id_md5 = md5($this->user_id);
if (I0_FULL_ANONYMITY_MODE) {
@ -233,6 +233,9 @@ class Posting {
function CheckDefaultCaptcha() {
$code = $_SESSION['security_code'];
unset($_SESSION['security_code']);
if (!$code || !isset($_POST['captcha']) || !$_POST['captcha']) {
return 'incorrect';
}
$submit_time = time();
if($submit_time - $_SESSION['captchatime'] > KU_CAPTCHALIFE) {
return 'expired';

View File

@ -473,7 +473,7 @@ function TrimToPageLimit($board) {
$post_class->Delete(true);
}
}
if ($board['maxpages'] != 0) {
if (!I0_DISABLE_THREAD_LIMIT && $board['maxpages'] != 0) {
// If the maximum pages setting is not zero (do not limit pages), find posts which are over the limit, and delete them
$results = $tc_db->GetAll("SELECT `id`, `stickied` FROM `".KU_DBPREFIX."posts` WHERE `boardid` = " . $board['id'] . " AND `IS_DELETED` = 0 AND `parentid` = 0");
$results_count = count($results);