Clean up log entry output if not fully authenticated
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 30 Jun 2010 20:04:29 +0000 (14:04 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 30 Jun 2010 20:04:29 +0000 (14:04 -0600)
imp/lib/Auth.php

index 5588696..c1a9ce5 100644 (file)
@@ -146,13 +146,13 @@ class IMP_Auth
         $imap_ob = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb();
 
         $msg = sprintf(
-            $status_msg . '%s [%s]%s to {%s:%s [%s]}',
-            $auth_id ? '' : ' for ' . $auth_id,
+            $status_msg . '%s [%s]%s to {%s:%s%s}',
+            !strlen($auth_id) ? '' : ' for ' . $auth_id,
             $_SERVER['REMOTE_ADDR'],
             empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? '' : ' (forwarded for [' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '])',
             $imap_ob ? $imap_ob->getParam('hostspec') : '',
             $imap_ob ? $imap_ob->getParam('port') : '',
-            empty($_SESSION['imp']['protocol']) ? '' : $_SESSION['imp']['protocol']
+            empty($_SESSION['imp']['protocol']) ? '' : ' [' . $_SESSION['imp']['protocol'] . ']'
         );
 
         Horde::logMessage($msg, $level);