* *
* -------------------------------------------------------------------- *
* File : removeip_functions.php *
* *
* -------------------------------------------------------------------- *
* File : removeip_functions.php *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Spezielle Funktion fuer removeip-Erweiterung *
* -------------------------------------------------------------------- *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Spezielle Funktion fuer removeip-Erweiterung *
* -------------------------------------------------------------------- *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
- case "127.0.0.1": // mod_removeip style
- case "0.0.0.0": // Some people may prefer this...
- $remoteAddr = getConfig('anonymous_ip');
+ case 'LOCAL': // localhost
+ $remoteAddr = '127.0.0.1';
+ break;
+
+ case 'ZERO': // All four numbers zero
+ $remoteAddr = '0.0.0.0';
- case "RANDOM": // Pseudo-random IP number
- $remoteAddr = mt_rand(1,254).".".mt_rand(0,254).".".mt_rand(0,254).".".mt_rand(1,254);
+ case 'RANDOM': // Generate random ip
+ $remoteAddr = mt_rand(1, 254) . '.' . mt_rand(0, 254) . '.'.mt_rand(0, 254) . '.' . mt_rand(1, 254);
- if (getConfig('removeip_anon_ip') == "Y") $anonymity++;
- if (getConfig('removeip_anon_host') == "Y") $anonymity++;
- if (getConfig('removeip_anon_ua') == "Y") $anonymity++;
- if (getConfig('removeip_anon_ref') == "Y") $anonymity++;
+ if (getConfig('removeip_anon_ip') == 'Y') $anonymity++;
+ if (getConfig('removeip_anon_host') == 'Y') $anonymity++;
+ if (getConfig('removeip_anon_ua') == 'Y') $anonymity++;
+ if (getConfig('removeip_anon_ref') == 'Y') $anonymity++;
// Calculate anonymity level
$level = round($anonymity / 4 * 3);
// Set constant name suffix depending on that level
// Calculate anonymity level
$level = round($anonymity / 4 * 3);
// Set constant name suffix depending on that level