-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
online tracking turned off vs online menu #3681
Comments
The code for this is already there, but not working because if(!defined('e_TRACKING_DISABLED'))
{
$text = $tp->parseTemplate($ONLINE_TEMPLATE['enabled'], TRUE, $online_shortcodes);
}
else
{
if (ADMIN)
{
$text = $tp->parseTemplate($ONLINE_TEMPLATE['disabled'], TRUE, $online_shortcodes);
}
else
{
return;
}
} Working on it. |
@CaMer0n
if(!isset($_E107['no_online']) && varset($pref['track_online']))
{
e107::getOnline()->goOnline($pref['track_online'], $pref['flood_protect']);
} It's because
I propose changing if(!isset($_E107['no_online']) && varset($pref['track_online']))
{
e107::getOnline()->goOnline($pref['track_online'], $pref['flood_protect']);
} to if(!isset($_E107['no_online']))
{
e107::getOnline()->goOnline($pref['track_online'], $pref['antiflood1']);
} or use the constant
if($online_tracking === false && $flood_control === false)
{
define('e_TRACKING_DISABLED', true); // Used in forum, online menu
... This means that aside from changing the preference As these are pretty important defines and methods in class2.php I am not changing it myself... |
Looking at this commit d5711fd This if($online_tracking || $flood_control) was replaced with: if($online_tracking === false && $flood_control === false) I'm guessing it should be || (OR) not && (AND) |
@Moc I believe you're correct. |
Looks good to me. I was curious about why there are two different variables for flood protection (
$ git show 19468aec78
commit 19468aec789ded31d397796f045803c0eb14509b (HEAD)
Author: loloirie <loloirie@8cb2f43a-d3f2-4d94-9ba2-05e386d4b0b9>
Date: Thu Jul 8 15:55:16 2004 +0000
Use prefs for antiflood (antiflood func) and autoban (online func) and cleaned for old flood prefs
diff --git a/e107/class2.php b/e107/class2.php
index 86aad3cab..ef4b816f1 100644
--- a/e107/class2.php
+++ b/e107/class2.php
@@ -342,8 +342,8 @@ if(e_QUERY == "logout"){
ban();
define("TIMEOFFSET", $pref['time_offset']);
-define("FLOODTIME", $pref['flood_time']);
-define("FLOODHITS", $pref['flood_hits']);
+//define("FLOODTIME", $pref['flood_time']);
+//define("FLOODHITS", $pref['flood_hits']);
if(strstr(e_SELF, $ADMIN_DIRECTORY) && $pref['admintheme'] && !$_POST['sitetheme']){
if(strstr(e_SELF, "menus.php")){
@@ -365,7 +365,8 @@ if(strstr(e_SELF, $ADMIN_DIRECTORY) && $pref['admintheme'] && !$_POST['sitetheme
if($pref['anon_post'] ? define("ANON", TRUE) : define("ANON", FALSE));
if(Empty($pref['newsposts']) ? define("ITEMVIEW", 15) : define("ITEMVIEW", $pref['newsposts']));
-if($pref['flood_protect']){ define(FLOODPROTECT, TRUE); define(FLOODTIMEOUT, $pref['flood_timeout']); }
+
+if($pref['$antiflood1']==1){ define(FLOODPROTECT, TRUE); define(FLOODTIMEOUT, $pref['antiflood_timeout']); }
define ("HEADERF", e_THEME."templates/header".$layout.".php");
define ("FOOTERF", e_THEME."templates/footer".$layout.".php");
@@ -884,7 +885,7 @@ function online(){
}
}
- if(ADMIN){$online_pagecount=1;}
+ if(ADMIN || $pref['autoban']!=1){$online_pagecount=1;}
if($online_pagecount > $online_bancount && $online_ip !="127.0.0.1"){
$sql -> db_Insert("banlist", "'$ip', '0', 'Hit count exceeded ($online_pagecount requests within allotted time)' ");
exit;
@@ -955,7 +956,7 @@ class floodprotect{
# - scope public
*/
$sql = new db;
- if(FLOODPROTECTION == TRUE){
+ if(FLOODPROTECT == TRUE){
$sql -> db_Select($table, "*", "ORDER BY ".$orderfield." DESC LIMIT 1", "no_where");
$row = $sql -> db_Fetch();
return ($row[$orderfield] > (time() - FLOODTIMEOUT) ? FALSE : TRUE); Perhaps we should introduce a database migration that chooses one pref name and removes the other we don't want? |
Done. This could use some testing. I hope no negative affects arise when it comes to flood protection and automated banning of those triggering the flood protection. The online menu menu now functions correctly. @CaMer0n The only thing that needs to be done I guess is removing the |
@Moc: In if (e107::getConfig()->has('flood_protect'))
{
if ($just_check)
{
return update_needed("Unused pref for flood protection");
}
else
{
e107::getConfig()->remove('flood_protect');
}
} |
@Deltik @CaMer0n I noticed e107/e107_admin/update_routines.php Line 467 in 618db45
If I read it correctly, it will check for missing core prefs. Perhaps we expand this function to also delete core prefs that exist in the table, but are no longer present in the install.xml file ( |
If you turn online tracking off and forget to remove the online menu, the result is this:
There should be a similar message like with stats plugin at least for main admin that tracking is off and for others, this shouldn't be displayed at all.
The text was updated successfully, but these errors were encountered: