-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stable9] Fixed dynamic group ldap access #24950
Conversation
getUserGroups: Using $userDN instead of $uid to query LDAP Converting groupDN to group name using API instead of substring Removing cache processing at the end of the method
added back the cache processing and fixed
spaces -> tab conversion
By analyzing the blame information on this pull request, we identified @alexweirig, @blizzz and @leo-b to be potential reviewers |
Fixes #23081 |
@@ -530,11 +531,12 @@ public function getUserGroups($uid) { | |||
} | |||
|
|||
if(isset($this->cachedGroupsByMember[$uid])) { | |||
$groups = $this->cachedGroupsByMember[$uid]; | |||
$groups[] = $this->cachedGroupsByMember[$uid]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong, do you mean array_merge
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickvergessen it was like this in the original PR, so probably intentional ?
@alexweirig can you comment (I believe it was your change)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PVince81
yes, that's what seems to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some debugging to check the values of the arrays. It seems that in the cases I tested this part of the code never gets executed, probably because the user's groups are already cached.
I suppose it is very rare that this code path will be reached. For that one would have to call getUserGroups
for multiple users within the same PHP request.
@nickvergessen is right that this needs an array_merge
. I'll make a PR to master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even the cron jobs don't go there
@PVince81
or do I need to download a different version of owncloud? Many thanks in advance Alex |
@PVince81 |
@alexweirig you could download the daily stable9 build and then apply the patched from this PR on top of it. This way there is less risk of conflicts. |
@PVince81 @blizzz I then tested the dynamic group memberships and everything seems to work just as I expected. Code is OK for me! |
@alexweirig thanks, counting as thumbs up 👍 |
@PVince81 BTW: I can't apply the patch to the daily build because the user_ldap application has completely changed ... The php have moved and the patch doesn't find them anymore. |
@PVince81 |
With daily stable you mean the master one ? (9.1) The patch of this PR is intended to be used for 9.0.x |
@PVince81
So this looks good |
I suggest we merge this then directly fix this piece #24950 (comment) both on master + backport to 9.0 |
Well fine by me, but I think it needs fixing |
PR for master for missing array_merge: #25024 I pushed the commit here too: b37f2e2 @alexweirig mind redoing a test on 9.0 with that extra commit ? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Backport of #23450 to stable9
Please review and test @owncloud/ldap @owncloud/qa @alexweirig