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: 1 addition & 0 deletions Languages/en_US/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@
// argument(s): scripturl
$helptxt['who_enabled'] = 'This setting allows you to turn on or off the <a href="{scripturl}?action=who" target="_blank" rel="noopener">Who’s Online</a> page, which shows who is browsing the forum and what they are doing.';

$helptxt['no_guest_logging'] = 'This setting prevents guests from being included in the Users Online counts. Guest and bot activity can cause excessive IO, so this may help during a bot attack.';
$helptxt['no_guest_views'] = 'This setting disables incrementing views for guests as well as bots. Bot activity can cause excessive IO, and is often disguised as guest activity, so this may help during a bot attack.';

$helptxt['recycle_enable'] = '&quot;Recycles&quot; deleted topics and posts to the specified board.';
Expand Down
1 change: 1 addition & 0 deletions Languages/en_US/ManageSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
$txt['timeLoadPageEnable'] = 'Display time taken to create every page';
$txt['disableHostnameLookup'] = 'Disable hostname lookups';
$txt['who_enabled'] = 'Enable who’s online list';
$txt['no_guest_logging'] = 'Do not include guests or bots in Users Online stats';
$txt['no_guest_views'] = 'Disable counting views for guests and bots';
$txt['settings_error'] = 'Warning: Updating of Settings.php failed, the settings cannot be saved.';
$txt['image_proxy_enabled'] = 'Enable Image Proxy';
Expand Down
1 change: 1 addition & 0 deletions Sources/Actions/Admin/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,7 @@ public static function basicConfigVars(): array
'',

// Guest stats.
['check', 'no_guest_logging'],
['check', 'no_guest_views'],
'',

Expand Down
5 changes: 5 additions & 0 deletions Sources/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,11 @@ public function logOnline(bool $force = false): void
self::logSpider();
}

// Don't log guests anymore - helps during bot attacks.
if (!empty(Config::$modSettings['no_guest_logging']) && !empty(User::$me->is_guest)) {
return;
}

// Don't mark them as online more than every so often.
if (!empty($_SESSION['log_time']) && $_SESSION['log_time'] >= (time() - 8) && !$force) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Themes/default/BoardIndex.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ function template_ic_block_online()
</h4>
</div>
<p class="inline">
', Utils::$context['show_who'] ? '<a href="' . Config::$scripturl . '?action=who">' : '', '<strong>', Lang::getTxt('online', file: 'General'), ': </strong>', Lang::getTxt('number_of_guests', [Utils::$context['num_guests']], file: 'General'), ', ', Lang::getTxt('number_of_members', [Utils::$context['num_users_online']], file: 'General');
', Utils::$context['show_who'] ? '<a href="' . Config::$scripturl . '?action=who">' : '', '<strong>', Lang::getTxt('online', file: 'General'), ': </strong>', empty(Config::$modSettings['no_guest_logging']) ? Lang::getTxt('number_of_guests', [Utils::$context['num_guests']], file: 'General') . ', ' : '', Lang::getTxt('number_of_members', [Utils::$context['num_users_online']], file: 'General');

// Handle hidden users and buddies.
$bracketList = [];
Expand Down
Loading