[pLog-svn] r3898 - plog/trunk/class/net

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sat Aug 19 15:17:47 GMT 2006


Author: jondaley
Date: 2006-08-19 15:17:46 +0000 (Sat, 19 Aug 2006)
New Revision: 3898

Modified:
   plog/trunk/class/net/client.class.php
Log:
ip based blocking doesn't really work at the moment - 0ipabuse noticed this, and isn't using this class.  If we don't want to change this class's behavior, we need a new function, because the proxy ip isn't worth anything, except for possibly trying to differentiate between users behind a firewall, such as or voting, karma, etc.

Modified: plog/trunk/class/net/client.class.php
===================================================================
--- plog/trunk/class/net/client.class.php	2006-08-19 15:12:29 UTC (rev 3897)
+++ plog/trunk/class/net/client.class.php	2006-08-19 15:17:46 UTC (rev 3898)
@@ -162,11 +162,6 @@
             }
         } // end if
 
-        // Gets the default ip sent by the user
-        if (!empty($REMOTE_ADDR)) {
-            $direct_ip = $REMOTE_ADDR;
-        }
-
         // Gets the proxy ip sent by the user
         $proxy_ip     = '';
         if (!empty($HTTP_X_FORWARDED_FOR)) {
@@ -186,6 +181,15 @@
         } // end if... else if...
 
         // Returns the true IP if it has been found, else FALSE
+        if(!empty($REMOTE_ADDR))
+            return $REMOTE_ADDR;
+        else
+            return FALSE;
+
+            // NOTE: the proxy addresses can be faked - shouldn't be depended on
+            // for security - perhaps plugins like karma, et al. might want to use
+            // this value, but all ip-based-blocking need the REMOTE_ADDR
+/*        
         if (empty($proxy_ip)) {
             // True IP without proxy
             return $direct_ip;
@@ -200,6 +204,8 @@
                 return FALSE;
             }
         } // end if... else...
+*/
     } // end of the 'PMA_getIp()' function
+
     }
 ?>



More information about the pLog-svn mailing list