summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/user_ldap.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-10-27 15:58:23 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-10-27 15:58:23 +0100
commit05b2a037f227a7ebe0bf8e9325c271d698f02e1b (patch)
tree307ef026b4a6c419d3ae38effe384cf86f32236b /apps/user_ldap/user_ldap.php
parent5d391910c52309d7c538a2494927b3720dc06d0a (diff)
downloadnextcloud-server-05b2a037f227a7ebe0bf8e9325c271d698f02e1b.tar.gz
nextcloud-server-05b2a037f227a7ebe0bf8e9325c271d698f02e1b.zip
dont fail with 500 if configured display name attribute is not set
Diffstat (limited to 'apps/user_ldap/user_ldap.php')
-rw-r--r--apps/user_ldap/user_ldap.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index ae4dfec5118..6e244311d4a 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -64,8 +64,14 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
return false;
}
$dn = $ldap_users[0];
-
$user = $this->access->userManager->get($dn);
+ if(is_null($user)) {
+ \OCP\Util::writeLog('user_ldap',
+ 'LDAP Login: Could not get user object for DN ' . $dn .
+ '. Maybe the LDAP entry has no set display name attribute?',
+ \OCP\Util::WARN);
+ return false;
+ }
if($user->getUsername() !== false) {
//are the credentials OK?
if(!$this->access->areCredentialsValid($dn, $password)) {