]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix retrieval of user groups
authorArthur Schiwon <blizzz@owncloud.com>
Mon, 12 Jan 2015 15:25:11 +0000 (16:25 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 12 Jan 2015 15:25:11 +0000 (16:25 +0100)
apps/user_ldap/lib/access.php
apps/user_ldap/lib/connection.php

index f3657176f70ad0bfd7e3e9068e61c02881d40975..0fb968cebe7b26dae8941fed7ae7ee3af988caa3 100644 (file)
@@ -149,7 +149,11 @@ class Access extends LDAPUtility implements user\IUserTools {
                $this->abandonPagedSearch();
                // openLDAP requires that we init a new Paged Search. Not needed by AD,
                // but does not hurt either.
-               $this->initPagedSearch($filter, array($dn), array($attr), 1, 0);
+               $pagingSize = intval($this->connection->ldapPagingSize);
+               // 0 won't result in replies, small numbers may leave out groups
+               // (cf. #12306), 500 is default for paging and should work everywhere.
+               $maxResults = $pagingSize < 20 ? $pagingSize : 500;
+               $this->initPagedSearch($filter, array($dn), array($attr), $maxResults, 0);
                $dn = $this->DNasBaseParameter($dn);
                $rr = @$this->ldap->read($cr, $dn, $filter, array($attr));
                if(!$this->ldap->isResource($rr)) {
index c9b4fded9f9049f03d36275755fde2c8966188b2..a9d21ffc8e78d9f91c728e2ccd35e41911c92b7d 100644 (file)
@@ -26,11 +26,13 @@ namespace OCA\user_ldap\lib;
 //magic properties (incomplete)
 /**
  * responsible for LDAP connections in context with the provided configuration
+ *
  * @property string ldapUserFilter
  * @property string ldapUserDisplayName
  * @property boolean hasPagedResultSupport
  * @property string[] ldapBaseUsers
-*/
+ * @property int|string ldapPagingSize holds an integer
+ */
 class Connection extends LDAPUtility {
        private $ldapConnectionRes = null;
        private $configPrefix;