From 5d3183afcdeb5cde648a40ba4ef0b2389c20d90e Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sat, 5 Mar 2016 00:18:34 +0100 Subject: [PATCH] improve log output when no LDAP user was found on login attempt --- apps/user_ldap/lib/connection.php | 2 ++ apps/user_ldap/user_ldap.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index fc6df5fc60..d5b4936b68 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -34,6 +34,8 @@ use OC\ServerNotAvailableException; * magic properties (incomplete) * responsible for LDAP connections in context with the provided configuration * + * @property string ldapHost + * @property string ldapPort holds the port number * @property string ldapUserFilter * @property string ldapUserDisplayName * @property string ldapUserDisplayName2 diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 865b7e6189..26d3429818 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -102,7 +102,8 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn $attrs = $this->access->userManager->getAttributes(); $users = $this->access->fetchUsersByLoginName($loginName, $attrs, 1); if(count($users) < 1) { - throw new \Exception('No user available for the given login name.'); + throw new \Exception('No user available for the given login name on ' . + $this->access->connection->ldapHost . ':' . $this->access->connection->ldapPort); } return $users[0]; }