Commit f5dc27cc authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(management) Add support for whitelist in selectManagement

issue #5965
Showing with 14 additions and 1 deletion
+14 -1
...@@ -246,8 +246,21 @@ class managementFilter ...@@ -246,8 +246,21 @@ class managementFilter
return [$entries, $objectTypeCount]; return [$entries, $objectTypeCount];
} }
protected function filterEntries(array $ldapEntries): array protected function filterEntries (array $ldapEntries): array
{ {
if (!empty($this->parent->whiteList)) {
foreach ($ldapEntries as $dn => $entry) {
if (in_array($dn, $this->parent->whiteList['dn'])) {
continue;
}
foreach ($this->parent->whiteList['branches'] as $branch) {
if (preg_match('/'.preg_quote($branch, '/').'$/', $dn)) {
continue 2;
}
}
unset($entries[$dn]);
  • :warning: Review the data-flow - use of uninitialized value. :blue_book:

    By Ghost User on 2019-04-17T14:19:36 (imported from GitLab)

Please register or sign in to reply
}
}
if (isset($this->parent->blackList)) { if (isset($this->parent->blackList)) {
foreach ($this->parent->blackList as $attr_name => $attr_values) { foreach ($this->parent->blackList as $attr_name => $attr_values) {
foreach ($attr_values as $match) { foreach ($attr_values as $match) {
......
  • SonarQube analysis reported 2 issues

    • :warning: 2 major

    Watch the comments in this conversation to review them.

    1 extra issue

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. :warning: Review the data-flow - use of uninitialized value. :blue_book:

    By Ghost User on 2019-04-17T14:19:37 (imported from GitLab)

Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment