]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Addded more fields to server_name_log table, fixed out-dated ext-admins
[mailer.git] / inc / wrapper-functions.php
index dbc24d16796050d6e84cd70f73d72a078014ead9..ce8ad1099950f6b4eed1ddf32f921f1c9eac0dce 100644 (file)
@@ -172,7 +172,7 @@ function merge_array ($array1, $array2, $keepIndex = FALSE) {
 
        // Maintain index of array2?
        if ($keepIndex === TRUE) {
-               // Keep index of array2, array_merge() rewrites $key=2 to $key=0 ! :(
+               // Keep index of array2, array_merge() rewrites e.g. $key=1 to $key=0, $key=2 to $key=1 ! :(
                foreach ($array2 as $key => $value) {
                        // Add it
                        $array1[$key] = $value;
@@ -214,12 +214,12 @@ function isDirectory ($FQFN) {
 }
 
 // "Getter" for the real remote IP number
-function detectRealIpAddress () {
+function detectRealIpAddress ($alwaysReal = FALSE) {
        // Get remote ip from environment
        $remoteAddr = determineRealRemoteAddress();
 
        // Is removeip installed?
-       if (isExtensionActive('removeip')) {
+       if ((isExtensionActive('removeip')) && ($alwaysReal === FALSE)) {
                // Then anonymize it
                $remoteAddr = getAnonymousRemoteAddress($remoteAddr);
        } // END - if
@@ -229,12 +229,12 @@ function detectRealIpAddress () {
 }
 
 // "Getter" for remote IP number
-function detectRemoteAddr () {
+function detectRemoteAddr ($alwaysReal = FALSE) {
        // Get remote ip from environment
        $remoteAddr = determineRealRemoteAddress(TRUE);
 
        // Is removeip installed?
-       if (isExtensionActive('removeip')) {
+       if ((isExtensionActive('removeip')) && ($alwaysReal === FALSE)) {
                // Then anonymize it
                $remoteAddr = getAnonymousRemoteAddress($remoteAddr);
        } // END - if
@@ -244,12 +244,12 @@ function detectRemoteAddr () {
 }
 
 // "Getter" for remote hostname
-function detectRemoteHostname () {
+function detectRemoteHostname ($alwaysReal = FALSE) {
        // Get remote ip from environment
        $remoteHost = getenv('REMOTE_HOST');
 
        // Is removeip installed?
-       if (isExtensionActive('removeip')) {
+       if ((isExtensionActive('removeip')) && ($alwaysReal === FALSE)) {
                // Then anonymize it
                $remoteHost = getAnonymousRemoteHost($remoteHost);
        } // END - if
@@ -274,12 +274,12 @@ function detectUserAgent ($alwaysReal = FALSE) {
 }
 
 // "Getter" for referer
-function detectReferer () {
+function detectReferer ($alwaysReal = FALSE) {
        // Get remote ip from environment
        $referer = getenv('HTTP_REFERER');
 
        // Is removeip installed?
-       if (isExtensionActive('removeip')) {
+       if ((isExtensionActive('removeip')) && ($alwaysReal === TRUE)) {
                // Then anonymize it
                $referer = getAnonymousReferer($referer);
        } // END - if