Merge pull request #22880 from owncloud/fix-21656

improve log output when no LDAP user was found on login attempt
This commit is contained in:
Thomas Müller 2016-03-07 17:12:01 +01:00
commit 0487b541a0
2 changed files with 4 additions and 1 deletions

View File

@ -34,6 +34,8 @@ use OC\ServerNotAvailableException;
* magic properties (incomplete) * magic properties (incomplete)
* responsible for LDAP connections in context with the provided configuration * 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 ldapUserFilter
* @property string ldapUserDisplayName * @property string ldapUserDisplayName
* @property string ldapUserDisplayName2 * @property string ldapUserDisplayName2

View File

@ -102,7 +102,8 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
$attrs = $this->access->userManager->getAttributes(); $attrs = $this->access->userManager->getAttributes();
$users = $this->access->fetchUsersByLoginName($loginName, $attrs, 1); $users = $this->access->fetchUsersByLoginName($loginName, $attrs, 1);
if(count($users) < 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]; return $users[0];
} }