Esempio n. 1
0
 /**
  * Log login related message.
  *
  * @param boolean $status    True on success, false on failure.
  * @param IMP_Imap $imap_ob  The IMP_Imap object to use.
  */
 protected static function _log($status, $imap_ob)
 {
     $msg = $status ? 'Login success' : 'FAILED LOGIN';
     $user = $imap_ob->getParam('username');
     if (($auth_id = $GLOBALS['registry']->getAuth()) && $user != $auth_id) {
         $user .= ' (Horde user ' . $auth_id . ')';
     }
     Horde::log(sprintf($msg . ' for %s (%s)%s to {%s}', $user, $_SERVER['REMOTE_ADDR'], empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? '' : ' (forwarded for [' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '])', $imap_ob->url), $status ? 'NOTICE' : 'INFO');
 }