From 90aae489bfe439bc0343c83edc8e370003850fab Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 24 Jan 2011 17:04:27 -0700 Subject: [PATCH] Better IMP login logging when not using IMP as authentication method --- imp/lib/Auth.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index 4d715261f..1e684f5c4 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -182,11 +182,14 @@ class IMP_Auth $level = 'INFO'; } - $auth_id = $GLOBALS['registry']->getAuth(); + $user = $imap_ob->getParam('username'); + if (($auth_id = $GLOBALS['registry']->getAuth()) !== false) { + $user .= ' (Horde user ' . $auth_id . ')'; + } $msg = sprintf( - $msg . ' %s [%s]%s to {%s:%s%s}', - !strlen($auth_id) ? '' : 'for ' . $auth_id, + $msg . ' for %s [%s]%s to {%s:%s%s}', + $user, $_SERVER['REMOTE_ADDR'], empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? '' : ' (forwarded for [' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '])', $imap_ob->ob ? $imap_ob->getParam('hostspec') : '', -- 2.11.0