From e81ea6f299349a43cdaefc4a5a01c3da12283aac Mon Sep 17 00:00:00 2001 From: Shawn Bulen Date: Wed, 6 May 2026 12:44:19 -0700 Subject: [PATCH 1/5] Only log after testing if guests should be kicked Signed-off-by: Shawn Bulen --- index.php | 72 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/index.php b/index.php index 2ff89336ba..13a992b14b 100644 --- a/index.php +++ b/index.php @@ -240,42 +240,6 @@ function smf_main() if (!empty($topic) && empty($board_info['cur_topic_approved']) && !allowedTo('approve_posts') && ($user_info['id'] != $board_info['cur_topic_starter'] || $user_info['is_guest'])) fatal_lang_error('not_a_topic', false); - // Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed, popup, etc. - $no_stat_actions = array( - 'about:unknown' => true, - 'clock' => true, - 'dlattach' => true, - 'findmember' => true, - 'helpadmin' => true, - 'jsoption' => true, - 'likes' => true, - 'modifycat' => true, - 'pm' => array('sa' => array('popup')), - 'profile' => array('area' => array('popup', 'alerts_popup', 'download', 'dlattach')), - 'requestmembers' => true, - 'smstats' => true, - 'suggest' => true, - 'uploadAttach' => true, - 'verificationcode' => true, - 'viewquery' => true, - 'viewsmfile' => true, - 'xmlhttp' => true, - '.xml' => true, - ); - call_integration_hook('integrate_pre_log_stats', array(&$no_stat_actions)); - - $should_log = !is_filtered_request($no_stat_actions, 'action'); - if ($should_log) - { - // Log this user as online. - writeLog(); - - // Track forum statistics and hits...? - if (!empty($modSettings['hitStats'])) - trackStats(array('hits' => '+')); - } - unset($no_stat_actions); - // Make sure that our scheduled tasks have been running as intended check_cron(); @@ -337,6 +301,42 @@ function smf_main() } } + // Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed, popup, etc. + $no_stat_actions = array( + 'about:unknown' => true, + 'clock' => true, + 'dlattach' => true, + 'findmember' => true, + 'helpadmin' => true, + 'jsoption' => true, + 'likes' => true, + 'modifycat' => true, + 'pm' => array('sa' => array('popup')), + 'profile' => array('area' => array('popup', 'alerts_popup', 'download', 'dlattach')), + 'requestmembers' => true, + 'smstats' => true, + 'suggest' => true, + 'uploadAttach' => true, + 'verificationcode' => true, + 'viewquery' => true, + 'viewsmfile' => true, + 'xmlhttp' => true, + '.xml' => true, + ); + call_integration_hook('integrate_pre_log_stats', array(&$no_stat_actions)); + + $should_log = !is_filtered_request($no_stat_actions, 'action'); + if ($should_log) + { + // Log this user as online. + writeLog(); + + // Track forum statistics and hits...? + if (!empty($modSettings['hitStats'])) + trackStats(array('hits' => '+')); + } + unset($no_stat_actions); + // Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function). $actionArray = array( 'agreement' => array('Agreement.php', 'Agreement'), From 36449fcddc6b568018d530c46d9f1cad58af9e69 Mon Sep 17 00:00:00 2001 From: Shawn Bulen Date: Wed, 6 May 2026 13:02:41 -0700 Subject: [PATCH 2/5] No longer needed, since not logged Signed-off-by: Shawn Bulen --- Sources/Security.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Sources/Security.php b/Sources/Security.php index 633aab20e0..ae4b5a037b 100644 --- a/Sources/Security.php +++ b/Sources/Security.php @@ -103,11 +103,6 @@ function is_not_guest($message = '') if (!$user_info['is_guest']) return; - // Log what they were trying to do didn't work) - if (!empty($modSettings['who_enabled'])) - $_GET['error'] = 'guest_login'; - writeLog(true); - // Just die. if (isset($_REQUEST['xml'])) obExit(false); From be328354faee8413b4d67451b5ae596a620a5b9d Mon Sep 17 00:00:00 2001 From: Shawn Bulen Date: Wed, 6 May 2026 17:34:32 -0700 Subject: [PATCH 3/5] No longer needed, since not logged Signed-off-by: Shawn Bulen --- Sources/Security.php | 2 ++ Themes/default/languages/Who.english.php | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Security.php b/Sources/Security.php index ae4b5a037b..d718af60c6 100644 --- a/Sources/Security.php +++ b/Sources/Security.php @@ -103,6 +103,8 @@ function is_not_guest($message = '') if (!$user_info['is_guest']) return; + writeLog(true); + // Just die. if (isset($_REQUEST['xml'])) obExit(false); diff --git a/Themes/default/languages/Who.english.php b/Themes/default/languages/Who.english.php index 030e4ce96b..27189cd04e 100644 --- a/Themes/default/languages/Who.english.php +++ b/Themes/default/languages/Who.english.php @@ -19,7 +19,6 @@ $txt['who_no_online_spiders'] = 'There are currently no spiders online.'; $txt['who_no_online_guests'] = 'There are currently no guests online.'; $txt['who_no_online_members'] = 'There are currently no members online.'; -$txt['who_guest_login'] = 'User has been taken to the login page.'; $txt['whospider_login'] = 'Viewing the login page.'; $txt['whospider_register'] = 'Viewing the registration page.'; From 076b6234354d7478ccfd732e30a6da013a796774 Mon Sep 17 00:00:00 2001 From: Shawn Bulen Date: Wed, 6 May 2026 17:38:13 -0700 Subject: [PATCH 4/5] No longer needed, since not logged Signed-off-by: Shawn Bulen --- Sources/Who.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sources/Who.php b/Sources/Who.php index b9b5012a80..73c0f5388e 100644 --- a/Sources/Who.php +++ b/Sources/Who.php @@ -448,8 +448,6 @@ function determineActions($urls, $preferred_prefix = false) if (isset($txt[$actions['error']])) $error_message = str_replace('"', '"', empty($actions['error_params']) ? $txt[$actions['error']] : vsprintf($txt[$actions['error']], (array) $actions['error_params'])); - elseif ($actions['error'] == 'guest_login') - $error_message = str_replace('"', '"', $txt['who_guest_login']); else $error_message = str_replace('"', '"', $actions['error']); From 9a59e096673af1fb8312349c8f3bb562c7e5bb53 Mon Sep 17 00:00:00 2001 From: Shawn Bulen Date: Wed, 6 May 2026 17:48:41 -0700 Subject: [PATCH 5/5] No longer needed, since not logged Signed-off-by: Shawn Bulen --- Sources/Security.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Security.php b/Sources/Security.php index d718af60c6..54f60eec1a 100644 --- a/Sources/Security.php +++ b/Sources/Security.php @@ -103,6 +103,7 @@ function is_not_guest($message = '') if (!$user_info['is_guest']) return; + // Log what they were trying to do didn't work) writeLog(true); // Just die.