Mahor rewrite:
[mailer.git] / inc / libs / removeip_functions.php
index 8965fbdd71ed8121d5d3ce3a731b333262414072..e3b69e9e8b0a34cbffebf638a538d4ae684f0ef2 100644 (file)
@@ -39,15 +39,13 @@ if (!defined('__SECURITY')) {
 
 // "Getter" for anonymous remote IP number
 function GET_ANONYMOUS_REMOTE_ADDR ($remoteAddr) {
-       global $_CONFIG;
-
        // Is config enabled?
-       if ($_CONFIG['removeip_anon_ip'] == "Y") {
+       if (getConfig('removeip_anon_ip') == "Y") {
                // Switch way do we like?
-               switch ($_CONFIG['anonymous_ip']) {
+               switch (getConfig('anonymous_ip')) {
                        case "127.0.0.1": // mod_removeip style
                        case "0.0.0.0": // Some people may prefer this...
-                               $remoteAddr = $_CONFIG['anonymous_ip'];
+                               $remoteAddr = getConfig('anonymous_ip');
                                break;
 
                        case "RANDOM": // Pseudo-random IP number
@@ -61,10 +59,8 @@ function GET_ANONYMOUS_REMOTE_ADDR ($remoteAddr) {
 }
 // "Getter" for anonymous remote hostname
 function GET_ANONYMOUS_REMOTE_HOST ($remoteHost) {
-       global $_CONFIG;
-
        // Is config enabled?
-       if ($_CONFIG['removeip_anon_host'] == "Y") {
+       if (getConfig('removeip_anon_host') == "Y") {
                // Set anon hostname
                $remoteHost = "localhost.localnet";
        } // END - if
@@ -74,10 +70,8 @@ function GET_ANONYMOUS_REMOTE_HOST ($remoteHost) {
 }
 // "Getter" for anonymous user agent
 function GET_ANONYMOUS_USER_AGENT ($userAgent) {
-       global $_CONFIG;
-
        // Is config enabled?
-       if ($_CONFIG['removeip_anon_ua'] == "Y") {
+       if (getConfig('removeip_anon_ua') == "Y") {
                // Set anon user agent
                $userAgent = "-";
        } // END - if
@@ -87,10 +81,8 @@ function GET_ANONYMOUS_USER_AGENT ($userAgent) {
 }
 // "Getter" for anonymous referer
 function GET_ANONYMOUS_REFERER ($referer) {
-       global $_CONFIG;
-
        // Is config enabled?
-       if ($_CONFIG['removeip_anon_ref'] == "Y") {
+       if (getConfig('removeip_anon_ref') == "Y") {
                // Set anon user agent
                $referer = "-";
        } // END - if
@@ -100,16 +92,14 @@ function GET_ANONYMOUS_REFERER ($referer) {
 }
 // Adds informations about anonymity/privacy to the menu
 function REMOVEIP_ADD_INFOS () {
-       global $_CONFIG;
-
        // "Base-privacy" is by default low (we add more later)
        $anonymity = 0;
 
        // Is some data anonymized?
-       if ($_CONFIG['removeip_anon_ip']   == "Y") $anonymity++;
-       if ($_CONFIG['removeip_anon_host'] == "Y") $anonymity++;
-       if ($_CONFIG['removeip_anon_ua']   == "Y") $anonymity++;
-       if ($_CONFIG['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);