Skip to content

Commit

Permalink
Fixes #3681 - Properly detect antiflood and online tracking prefs
Browse files Browse the repository at this point in the history
- e_TRACKING_DISABLED is now properly defined when user tracking is turned off ('track_online').
- Use correct antiflood pref ('antiflood1')
- Remove old 'flood_protect' pref (which was not used anymore)
  • Loading branch information
Moc committed May 23, 2020
1 parent c03945c commit c92b6c5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions class2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2221,9 +2221,10 @@ function init_session()


$dbg->logTime('Go online');
if(!isset($_E107['no_online']) && varset($pref['track_online']))

if(!isset($_E107['no_online']))
{
e107::getOnline()->goOnline($pref['track_online'], $pref['flood_protect']);
e107::getOnline()->goOnline($pref['track_online'], $pref['antiflood1']);
}

$dbg->logTime('(After Go online)');
Expand Down
1 change: 0 additions & 1 deletion e107_core/xml/default_install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@
<core name="failed_login_limit">10</core>
<core name="filter_script">0</core>
<core name="flood_hits">100</core>
<core name="flood_protect">1</core>
<core name="flood_time">30</core>
<core name="flood_timeout">5</core>
<core name="forumdate">%a %b %d %Y, %I:%M%p</core>
Expand Down
2 changes: 1 addition & 1 deletion e107_handlers/online_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function goOnline($online_tracking = false, $flood_control = false)
//global $members_online, $total_online; // Not needed as globals
global $listuserson; // FIXME - remove it, make it property, call e_online signleton - e107::getOnline()

if($online_tracking === false && $flood_control === false)
if($online_tracking == false || $flood_control == false)
{
define('e_TRACKING_DISABLED', true); // Used in forum, online menu
define('TOTAL_ONLINE', '');
Expand Down
2 changes: 1 addition & 1 deletion e107_plugins/online/online_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function sc_lastseen_date()

function sc_online_tracking_disabled()
{
$url = e_ADMIN."users.php?mode=main&amp;action=prefs";
$url = e_ADMIN_ABS."users.php?mode=main&amp;action=prefs";

$srch = array("[","]");
$repl = array("<a href='".$url."'>", "</a>");
Expand Down

0 comments on commit c92b6c5

Please sign in to comment.