Expected behaviour
ownCloud should show me the group I am looking for when I type its name in the sharing dialogue.
Actual behaviour
Sometimes it does find the groups and shows them, but sometimes it does not.
The problem
We have an LDAP-Server which contains thousands of groups, but its response is limited to 500 entries. When I type in the name of the group I am looking for /owncloud/core/ajax/share.php is called and it tries to retrieve all the groups. So basically you are getting all the groups there are and you are searching this data instead of letting the LDAP-Server handle the search (please correct me if I am wrong). If I get lucky the 500 groups in the response contain the group I am looking for and ownCloud shows it to me, but a lot of times it does not.
Possible solution
Instead of doing the search yourself you could just give the LDAP-Server a filter and it would do the searching for you. Since the method getGroups has a parameter called "filter" I would suggest you pass it the value of whatever is inside of the text field of the sharing dialogue.
Changing line 182 in share.php from:
$groups = OC_Group::getGroups();
to:
$groups = OC_Group::getGroups($_GET['search']);
did the trick for me.
Server configuration
Operating system: Red Hat Enterprise Linux Server 6.3
Web server: Apache 2.2.15
Database: MySQL 5.5.32
PHP version: 5.4.17
ownCloud version: 5.0.9
Expected behaviour
ownCloud should show me the group I am looking for when I type its name in the sharing dialogue.
Actual behaviour
Sometimes it does find the groups and shows them, but sometimes it does not.
The problem
We have an LDAP-Server which contains thousands of groups, but its response is limited to 500 entries. When I type in the name of the group I am looking for /owncloud/core/ajax/share.php is called and it tries to retrieve all the groups. So basically you are getting all the groups there are and you are searching this data instead of letting the LDAP-Server handle the search (please correct me if I am wrong). If I get lucky the 500 groups in the response contain the group I am looking for and ownCloud shows it to me, but a lot of times it does not.
Possible solution
Instead of doing the search yourself you could just give the LDAP-Server a filter and it would do the searching for you. Since the method getGroups has a parameter called "filter" I would suggest you pass it the value of whatever is inside of the text field of the sharing dialogue.
Changing line 182 in share.php from:
to:
did the trick for me.
Server configuration
Operating system: Red Hat Enterprise Linux Server 6.3
Web server: Apache 2.2.15
Database: MySQL 5.5.32
PHP version: 5.4.17
ownCloud version: 5.0.9