summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-12-09 09:26:54 +0000
committeralecpl <alec@alec.pl>2010-12-09 09:26:54 +0000
commitad399a95dded2a0378eb410569dcac65c3c9c44a (patch)
tree44f4c02c2bf4aef1650ea6a336608b79f80360b2 /program/include/rcube_imap.php
parent4064452816e7e94b7a6dbc7b02cfc56d725408b2 (diff)
- Add username and IP address to log message on unsuccessful login (#1487626)
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index d1947c4a3..83c34bc3c 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -172,10 +172,14 @@ class rcube_imap
}
// write error log
else if ($this->conn->error) {
- if ($pass && $user)
+ if ($pass && $user) {
+ $message = sprintf("Login failed for %s from %s. %s",
+ $user, rcmail_remote_ip(), $this->conn->error);
+
raise_error(array('code' => 403, 'type' => 'imap',
'file' => __FILE__, 'line' => __LINE__,
- 'message' => $this->conn->error), true, false);
+ 'message' => $message), true, false);
+ }
}
return false;