Squirrelmail_logger behind reverse proxy
Strange, I was not able to find existing solutions for logging HTTP_X_FORWARDED_FOR in it's logs.
It's easy:
diff --git a/files/squirrel_logger/functions.php b/files/squirrel_logger/functions.php
index 5dfa8a1..6cef8dc 100644
--- a/files/squirrel_logger/functions.php
+++ b/files/squirrel_logger/functions.php
@@ -503,6 +503,8 @@ function sl_logit($event, $message='', $user='')
 
    if (!sqgetGlobalVar('REMOTE_ADDR', $user_address, SQ_SERVER))
       $user_address = '';
+   if (sqgetGlobalVar('HTTP_X_FORWARDED_FOR', $HTTP_X_FORWARDED_FOR, SQ_SERVER))
+          $user_address = $HTTP_X_FORWARDED_FOR.' (x-forwarded via '.$user_address. ')';
 
    if ($sl_namelookups)
       $user_address .= ' (' . gethostbyaddr($user_address) . ')'; 
 
No comments:
Post a Comment