summaryrefslogtreecommitdiff
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:01:28 (GMT)
commit7bd469fdfaff57ae572d42a35a1d44b631d4adb6 (patch)
treecd412f86e812977114ae9db60dff180953dae3c0
parentff79ce7ed1b04e3bb8d46fdc27ab30b830350fd9 (diff)
downloadroundcubemail-plugins-kolab-roundcubemail-plugins-kolab-3.1.4.tar.gz
Log failed logins (always)roundcubemail-plugins-kolab-3.1.4
-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 d027dea..1ce1f7e 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;
}