You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LDAP-Groups not found due to not using a filter #4201
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
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).
Let me correct you :) See group search attributes
Please revise your settings and try it out again.
I have already tried setting the group search attributes, this did not help. By using the group search attributes I am only able to compare attributes to some hardcoded values/strings.
It would help if I could set a filter to compare e.g. the cn to whatever the user entered, but as far as I know such a comparison is only possible for the User Login Filter.
I just tried setting the group search attribute to 'cn=%uid', this did not change anything and I think it would limit the results to groups which names contain my username, but now I cannot find any groups, not even the group which matches my username.
No, you just specify "cn". ownCloud will automatically insert the search query. Placeholders are neither required nor valid/possible.
Oh, I misunderstood the documentation..
Nevertheless after specifying "cn" instead of "cn=%uid", I still cannot find any LDAP-groups.
Tried setting and resetting multiple times and restarting apache.
Activity
blizzz commentedon Aug 17, 2013
Let me correct you :) See group search attributes
Please revise your settings and try it out again.
M4ui commentedon Aug 19, 2013
I have already tried setting the group search attributes, this did not help. By using the group search attributes I am only able to compare attributes to some hardcoded values/strings.
It would help if I could set a filter to compare e.g. the cn to whatever the user entered, but as far as I know such a comparison is only possible for the User Login Filter.
blizzz commentedon Aug 19, 2013
The search string is passed to the configured attributes, just like in the login filter.
M4ui commentedon Aug 19, 2013
I just tried setting the group search attribute to 'cn=%uid', this did not change anything and I think it would limit the results to groups which names contain my username, but now I cannot find any groups, not even the group which matches my username.
blizzz commentedon Aug 19, 2013
No, you just specify "cn". ownCloud will automatically insert the search query. Placeholders are neither required nor valid/possible.
M4ui commentedon Aug 19, 2013
Oh, I misunderstood the documentation..
Nevertheless after specifying "cn" instead of "cn=%uid", I still cannot find any LDAP-groups.
Tried setting and resetting multiple times and restarting apache.
blizzz commentedon Aug 21, 2013
Oh, yeah, the LDAP Backend does everything fine, but the search dialogue does not search properly. Stay tuned, should be resolved soon.
Use Group methods for searching, fixes #4201
Always use search method through Group Manager, fixes #4201