summaryrefslogtreecommitdiff
path: root/plugins/kolab_auth
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-04 10:59:38 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-04 11:00:27 (GMT)
commitc97615aeefeaed5feaa68034583949df7f9a96e2 (patch)
tree5fa72a1df33d73ed025e317c6c995a48f4fabecc /plugins/kolab_auth
parenta3ef9150a4f807c4051137ffe225fedc34fdbc13 (diff)
downloadroundcubemail-plugins-kolab-c97615aeefeaed5feaa68034583949df7f9a96e2.tar.gz
Log failed logins (always)
Diffstat (limited to 'plugins/kolab_auth')
-rw-r--r--plugins/kolab_auth/kolab_auth.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/kolab_auth/kolab_auth.php b/plugins/kolab_auth/kolab_auth.php
index e440218..cf5818f 100644
--- a/plugins/kolab_auth/kolab_auth.php
+++ b/plugins/kolab_auth/kolab_auth.php
@@ -339,6 +339,16 @@ class kolab_auth extends rcube_plugin
$ldap = self::ldap();
if (!$ldap || !$ldap->ready) {
$args['abort'] = true;
+ $message = sprintf(
+ 'Login failure for user %s from %s in session %s (error %s)',
+ $user,
+ rcube_utils::remote_ip(),
+ session_id(),
+ "LDAP not ready"
+ );
+
+ rcube::write_log('userlogins', $message);
+
return $args;
}
@@ -347,6 +357,16 @@ class kolab_auth extends rcube_plugin
if (empty($record)) {
$args['abort'] = true;
+ $message = sprintf(
+ 'Login failure for user %s from %s in session %s (error %s)',
+ $user,
+ rcube_utils::remote_ip(),
+ session_id(),
+ "No user record found"
+ );
+
+ rcube::write_log('userlogins', $message);
+
return $args;
}
@@ -380,6 +400,16 @@ class kolab_auth extends rcube_plugin
if (!$result) {
$args['abort'] = true;
+ $message = sprintf(
+ 'Login failure for user %s from %s in session %s (error %s)',
+ $user,
+ rcube_utils::remote_ip(),
+ session_id(),
+ "Unable to bind with '" . $record['dn'] . "'"
+ );
+
+ rcube::write_log('userlogins', $message);
+
return $args;
}
@@ -421,6 +451,17 @@ class kolab_auth extends rcube_plugin
if (empty($record)) {
$args['abort'] = true;
+ $message = sprintf(
+ 'Login failure for user %s (as user %s) from %s in session %s (error %s)',
+ $user,
+ $loginas,
+ rcube_utils::remote_ip(),
+ session_id(),
+ "No user record found for '" . $loginas . "'"
+ );
+
+ rcube::write_log('userlogins', $message);
+
return $args;
}