[rt-devel] [PATCH] Fix logging of client ip in ExternalAuth.pm

Martin Wheldon martin.wheldon at greenhills-it.co.uk
Sun Oct 2 06:44:55 EDT 2016


While debugging some configuration issues, I came across a problem with 
logging, RT 4.4.1 when using external authentication
always logs UNKNOWN as the clients IP address, the attached patch fixes 
the issue.

Fixes issue where UNKNOWN is logged as the clients IP address for all 
successful logins.

  lib/RT/Authen/ExternalAuth.pm | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/RT/Authen/ExternalAuth.pm 
index eff73bb..3f82cdc 100644
--- a/lib/RT/Authen/ExternalAuth.pm
+++ b/lib/RT/Authen/ExternalAuth.pm
@@ -444,8 +444,7 @@ sub DoAuth {

              $RT::Logger->info(  "Successful login for",
-                                "from",
-                                ($ENV{'REMOTE_ADDR'} || 'UNKNOWN') );
+                                "from", 
(RT::Interface::Web::RequestENV('REMOTE_ADDR') || 'UNKNOWN') );
              # Do not delete the session. User stays logged in and
              # autohandler will not check the password again


Best Regards

Martin Wheldon
Greenhills IT Ltd.
Telephone: 01904 238 454
Website: www.greenhills-it.co.uk

Greenhills IT Ltd. is a limited company registered in England and Wales.
Company Registration No: 06387214
Registered Offices: 2 Greenhills, Claxton, YORK, North Yorkshire, YO60 

More information about the rt-devel mailing list