Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Languages/en_US/Who.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
$txt['who_no_online_spiders'] = 'There are currently no robots 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.';
Expand Down
2 changes: 1 addition & 1 deletion Sources/Actions/Who.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ public static function determineActions(mixed $urls, string|bool $preferred_pref

if (isset($actions['error'])) {
$error_message = Lang::getTxt(
$actions['error'] == 'guest_login' ? 'who_guest_login' : $actions['error'],
$actions['error'],
(array) ($actions['error_params'] ?? []),
file: 'Who+Errors',
);
Expand Down
52 changes: 26 additions & 26 deletions Sources/Forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,32 +629,6 @@ protected function preflight(): void
ErrorHandler::fatalLang('not_a_topic', false);
}

// Don't log if this is an attachment, avatar, toggle of editor buttons,
// theme option, XML feed, popup, etc.
if (
self::$current_action?->canBeLogged() === true
|| (
self::$current_action === null
&& !QueryString::isFilteredRequest(self::$unlogged_actions, 'action')
)
) {
// Log this user as online.
User::$me->logOnline();

// Track forum statistics and hits...?
if (!empty(Config::$modSettings['hitStats'])) {
Logging::trackStats(['hits' => '+']);
}

// Login cookies should only expire after a period of inactivity.
// Since doing something worthy of logging means this member is
// actively engaged with the forum right now, refresh their login
// cookie in order to reset the countdown to its expiry date.
if (!User::$me->is_guest) {
Cookie::updateLoginCookieExpiry();
}
}

// Make sure that our scheduled tasks have been running as intended.
Config::checkCron();

Expand Down Expand Up @@ -682,6 +656,32 @@ protected function preflight(): void
) {
User::$me->kickIfGuest(null, false);
}

// Don't log if this is an attachment, avatar, toggle of editor buttons,
// theme option, XML feed, popup, etc.
if (
self::$current_action?->canBeLogged() === true
|| (
self::$current_action === null
&& !QueryString::isFilteredRequest(self::$unlogged_actions, 'action')
)
) {
// Log this user as online.
User::$me->logOnline();

// Track forum statistics and hits...?
if (!empty(Config::$modSettings['hitStats'])) {
Logging::trackStats(['hits' => '+']);
}

// Login cookies should only expire after a period of inactivity.
// Since doing something worthy of logging means this member is
// actively engaged with the forum right now, refresh their login
// cookie in order to reset the countdown to its expiry date.
if (!User::$me->is_guest) {
Cookie::updateLoginCookieExpiry();
}
}
}

/**
Expand Down
4 changes: 0 additions & 4 deletions Sources/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -1547,10 +1547,6 @@ public function kickIfGuest(?string $message = null, bool $log = true): void

// Log what they were trying to do that didn't work.
if ($log) {
if (!empty(Config::$modSettings['who_enabled'])) {
$_GET['error'] = 'guest_login';
}

$this->logOnline(true);
}

Expand Down
Loading