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
2 changes: 0 additions & 2 deletions Sources/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ function is_not_guest($message = '')
return;

// Log what they were trying to do didn't work)
if (!empty($modSettings['who_enabled']))
$_GET['error'] = 'guest_login';
writeLog(true);

// Just die.
Expand Down
2 changes: 0 additions & 2 deletions Sources/Who.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down
1 change: 0 additions & 1 deletion Themes/default/languages/Who.english.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
Expand Down
72 changes: 36 additions & 36 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Comment on lines -243 to -265
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably leave this array here just in case some site admin decided to modify it, unlikely as it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely unlikely that's been changed, IMO.

And to me it makes sense to keep the logging logic together, it's more readable.

In fact, it could (should?) be a single function call. An argument could be made to put that logic in Logging.php...


$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();

Expand Down Expand Up @@ -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'),
Expand Down
Loading