-
-
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
turn LDAP's treat remnants as disabled feature config-independent #46992
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Arthur Schiwon <[email protected]>
- *ldap_mark_remnants_as_disabled were old values and removed now, after - combining their value and storing into current backend_mark_remnants_as_disabled Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
65f3833
to
6a0351e
Compare
|
||
// if it was enabled for at least one configuration, use it as global configuration | ||
$filteredKeys = array_filter($allKeys, static function (string $key): bool { | ||
return str_contains($key, 'ldap_mark_remnants_as_disabled'); |
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.
return str_contains($key, 'ldap_mark_remnants_as_disabled'); | |
return str_ends_with($key, 'ldap_mark_remnants_as_disabled'); |
if (!$this->treatRemnantsAsDisabled()) { | ||
return $queryDatabaseValue(); | ||
} | ||
return !$this->deletedUsersIndex->isUserMarked($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.
Logic is wrong here.
If treatRemnantsAsDisabled is true and the user is not marked we should still query the DB.
if (!$this->treatRemnantsAsDisabled()) { | |
return $queryDatabaseValue(); | |
} | |
return !$this->deletedUsersIndex->isUserMarked($uid); | |
if ($this->treatRemnantsAsDisabled() && $this->deletedUsersIndex->isUserMarked($uid)) { | |
return false; | |
} else { | |
return $queryDatabaseValue(); | |
} |
@@ -414,6 +419,14 @@ protected function getLcValue(string $varName): string { | |||
return mb_strtolower($this->getValue($varName), 'UTF-8'); | |||
} | |||
|
|||
protected function getGlobalAppValueAsBool(string $varName): bool { |
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.
As it returns bool the magic property in phpdoc before the class should be typed to bool I think.
Also the default value in getDefaults is now unused for this property I think.
Summary
Since former LDAP users cannot be bound to a server configuration anymore (or theoretically belong to more than one) this feature has to be config independent. This PR:
A backport to 28 will need further adjustments as
IAppConfig
was only introduced in 29.Checklist