]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/removeip_functions.php
Re-added, now the right ones
[mailer.git] / inc / libs / removeip_functions.php
index 8965fbdd71ed8121d5d3ce3a731b333262414072..4e8c707d665752593f062d2b34fca3e0b25976a2 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Spezielle Funktion fuer removeip-Erweiterung     *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision:: 856                                                    $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
@@ -39,15 +44,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 +64,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 +75,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 +86,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 +97,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);
@@ -150,5 +145,20 @@ function REMOVEIP_ADD_INFOS () {
        return LOAD_TEMPLATE("removeip_level", true, $message);
 }
 
+// Filter for adding anonymity notice to the output stream
+function FILTER_ADD_ANONYMITY_NOTICE ($data) {
+       // Init content
+       $content = $data;
+
+       // Extension removeip activated?
+       if ((EXT_IS_ACTIVE("removeip")) && (getConfig('removeip_'.strtolower($data['access_level']).'_show') == "Y")) {
+               // Add anoymity/privacy infos
+               $content['content'] .= REMOVEIP_ADD_INFOS()."<br />\n";
+       } // END - if
+
+       // Return it
+       return $content;
+}
+
 //
 ?>