CF proxy IP forwarding + Overboard regeneration check

This commit is contained in:
0chan 2023-02-09 18:33:36 +06:00
parent be0053c827
commit 5a2d4e842b
3 changed files with 14 additions and 3 deletions

View File

@ -121,6 +121,12 @@ if (!$cache_loaded) {
$cf['I0_SAGE_DISABLED'] = false; // Disable sage function if you don't want anyone to abuse CSAM necroposting
$cf['I0_DISABLE_BAD_PROXY_POSTING'] = false; // If CF can't get user's GeoIP - then the proxy is marked as bad (xx country)
$cf['I0_DISABLE_TOR_POSTING'] = false; // Disable posting with T1 country detected by CF
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) {
$cf['I0_USER_IP'] = $_SERVER['HTTP_X_FORWARDED_FOR']; // for use with CF IP forwarding
} else {
$cf['I0_USER_IP'] = $_SERVER['REMOTE_ADDR'];
}
// --------------------------------------- CSS styles ---------------------------------------
$cf['KU_STYLES'] = 'modern:newdark:photon'; // Styles which are available to be used for the boards, separated by colons, in lower case. These will be displayed next to [Home] [Manage] if KU_STYLESWIKUHER is set to true

View File

@ -32,7 +32,12 @@ if ($is_index)
if ($board == I0_OVERBOARD_DIR) {
if ($page == 'catalog')
http_response_code(404);
$rendered_page = RegenerateOverboard(null, $page);
if (I0_OVERBOARD_ENABLED) {
$rendered_page = RegenerateOverboard(null, $page);
} else {
$rendered_page = 0;
}
do_redirect(KU_BOARDSPATH . '/' . I0_OVERBOARD_DIR . '/' . ((int)$rendered_page===0 ? '' : $rendered_page.'.html'), true);
}

View File

@ -10,7 +10,7 @@ $dwoo = new Dwoo();
$dwoo_data = new Dwoo_Data();
// Determine the User ID
if ((I0_IPLESS_MODE=='true' || (I0_IPLESS_MODE=='auto' && $_SERVER['REMOTE_ADDR']=='127.0.0.1'))) {
if ((I0_IPLESS_MODE=='true' || (I0_IPLESS_MODE=='auto' && I0_USER_IP =='127.0.0.1'))) {
if (isset($_COOKIE['I0_persistent_id'])) {
$user_id = $_COOKIE['I0_persistent_id'];
}
@ -20,7 +20,7 @@ if ((I0_IPLESS_MODE=='true' || (I0_IPLESS_MODE=='auto' && $_SERVER['REMOTE_ADDR'
$user_id = substr($user_id, 0, 45);
}
else {
$user_id = $_SERVER['REMOTE_ADDR'];
$user_id = I0_USER_IP;
}
$entries = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "modlog` WHERE `category`>=3 ORDER BY `timestamp` DESC");