]> source.dussan.org Git - nextcloud-server.git/commitdiff
Log warning when no uid was found for user
authorVincent Petry <pvince81@owncloud.com>
Thu, 9 Oct 2014 12:58:53 +0000 (14:58 +0200)
committerVincent Petry <pvince81@owncloud.com>
Fri, 10 Oct 2014 15:59:05 +0000 (17:59 +0200)
In some incomplete setups (like mine) it can happen that the uid
attribute of users is missing.

To be able to find out that something is wrong, a debug message is now
logged when it has not been found.

Backport of 59f9107dd9497d2eb9bd61f5eb8d893dd8fcb766 from master

apps/user_ldap/group_ldap.php

index 0d3a70575bae1e46922b5643242fe40471c3dd2f..48d097c360091d35cf2a1ae92a9b5dcdacae5254 100644 (file)
@@ -283,6 +283,10 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
                        $uid = $userDN;
                } else if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
                        $result = $this->access->readAttribute($userDN, 'uid');
+                       if ($result === false) {
+                               \OCP\Util::writeLog('user_ldap', 'No uid attribute found for DN ' . $userDN . ' on '.
+                                       $this->access->connection->ldapHost, \OCP\Util::DEBUG);
+                       }
                        $uid = $result[0];
                } else {
                        // just in case