-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[stable29] fix(user_ldap): Avoid extra LDAP request when mapping a user for the first time #51255
base: stable29
Are you sure you want to change the base?
Conversation
@@ -523,6 +569,36 @@ | |||
return false; | |||
} | |||
|
|||
if ($isUser) { | |||
$nameAttribute = strtolower($this->connection->ldapUserDisplayName); |
Check notice
Code scanning / Psalm
UndefinedMagicPropertyFetch Note
@@ -523,6 +569,36 @@ | |||
return false; | |||
} | |||
|
|||
if ($isUser) { | |||
$nameAttribute = strtolower($this->connection->ldapUserDisplayName); | |||
$filter = $this->connection->ldapUserFilter; |
Check notice
Code scanning / Psalm
UndefinedMagicPropertyFetch Note
$nameAttribute = strtolower($this->connection->ldapUserDisplayName); | ||
$filter = $this->connection->ldapUserFilter; | ||
$uuidAttr = 'ldapUuidUserAttribute'; | ||
$uuidOverride = $this->connection->ldapExpertUUIDUserAttr; |
Check notice
Code scanning / Psalm
UndefinedMagicPropertyFetch Note
$filter = $this->connection->ldapUserFilter; | ||
$uuidAttr = 'ldapUuidUserAttribute'; | ||
$uuidOverride = $this->connection->ldapExpertUUIDUserAttr; | ||
$usernameAttribute = strtolower($this->connection->ldapExpertUsernameAttr); |
Check notice
Code scanning / Psalm
UndefinedMagicPropertyFetch Note
$attributesToRead = [$nameAttribute,$usernameAttribute]; | ||
// TODO fetch also display name attributes and cache them if the user is mapped | ||
} else { | ||
$nameAttribute = strtolower($this->connection->ldapGroupDisplayName); |
Check notice
Code scanning / Psalm
UndefinedMagicPropertyFetch Note
// TODO fetch also display name attributes and cache them if the user is mapped | ||
} else { | ||
$nameAttribute = strtolower($this->connection->ldapGroupDisplayName); | ||
$filter = $this->connection->ldapGroupFilter; |
Check notice
Code scanning / Psalm
UndefinedMagicPropertyFetch Note
$nameAttribute = strtolower($this->connection->ldapGroupDisplayName); | ||
$filter = $this->connection->ldapGroupFilter; | ||
$uuidAttr = 'ldapUuidGroupAttribute'; | ||
$uuidOverride = $this->connection->ldapExpertUUIDGroupAttr; |
Check notice
Code scanning / Psalm
UndefinedMagicPropertyFetch Note
…first time Avoids using several LDAP searches to get UUID, display name and internal name, now gets all attributes at the same time. Also avoids extra request to build an unused user object in userExists. Signed-off-by: Côme Chilliet <[email protected]>
…n mapping new user Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Avoid surprises by making sure these are lowercased apart from documented special case user displayname. Signed-off-by: Côme Chilliet <[email protected]>
…anager Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
400fae4
to
7ea4c49
Compare
Backport of PR #50778