Commit b45e95c4 authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(management) Better handling of filter problems on some types only

When searching for a type cause an error (like no ACL for the
 attribute), the type is unchecked, the error shown and the search
 continues.
This allows to search for (sambaSID=*) for instance in systems without
 having to uncheck everything but workstations first.

issue #5867
parent 919785d4
......@@ -220,11 +220,22 @@ class managementFilter
$parentClass = get_class($this->parent);
if (!$parentClass::$skipTemplates && $this->showTemplates) {
$ldapEntries = objects::ls($type, $attrsAsked, (($this->scope == 'one') ? 'ou=templates,'.$searchBase : $searchBase), $filter, TRUE, $this->scope, TRUE);
try {
$ldapEntries = objects::ls($type, $attrsAsked, (($this->scope == 'one') ? 'ou=templates,'.$searchBase : $searchBase), $filter, TRUE, $this->scope, TRUE);
$objectTypeCount['template_'.$type] = count($ldapEntries);
foreach ($ldapEntries as $dn => $entry) {
$entries[$dn] = new ListingEntry($this->parent->listing, 'template_'.$type, $dn, $entry, $row++);
$objectTypeCount['template_'.$type] = count($ldapEntries);
foreach ($ldapEntries as $dn => $entry) {
$entries[$dn] = new ListingEntry($this->parent->listing, 'template_'.$type, $dn, $entry, $row++);
}
} catch (FusionDirectoryException $e) {
msg_dialog::display(
sprintf(
_('Could not search for "%s" templates'),
$this->types['filter_type_'.$type]['infos']['name']
),
$e->getMessage(),
WARNING_DIALOG
);
}
}
......@@ -232,9 +243,22 @@ class managementFilter
continue;
}
$ldapEntries = objects::ls($type, $attrsAsked, $searchBase, $filter, TRUE, $this->scope, FALSE, TRUE);
$ldapEntries = $this->filterEntries($ldapEntries);
try {
$ldapEntries = objects::ls($type, $attrsAsked, $searchBase, $filter, TRUE, $this->scope, FALSE, TRUE);
$ldapEntries = $this->filterEntries($ldapEntries);
} catch (FusionDirectoryException $e) {
msg_dialog::display(
sprintf(
_('Could not search for "%s"'),
$this->types['filter_type_'.$type]['infos']['name']
),
$e->getMessage(),
WARNING_DIALOG
);
$this->types['filter_type_'.$type]['show'] = FALSE;
continue;
}
$objectTypeCount[$type] = count($ldapEntries);
foreach ($ldapEntries as $dn => $entry) {
......
Markdown is supported
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