From 9fbb3d5d47bb48d2f9a4aa767ec8750997764ab3 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 1 Jun 2010 12:04:27 +0000 Subject: [PATCH] Filters require brakets () git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18820 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/dyngroup/classDynamicLdapGroup.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc b/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc index 02c74dd50..28ebd67b0 100644 --- a/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc +++ b/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc @@ -124,6 +124,16 @@ class DynamicLdapGroup extends plugin // A filter is required if(empty($entry['filter'])){ $messages[] = msgPool::required(_("Filter")." {$nr}"); + }else{ + + // Check if filter is valid + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search($entry['filter']); + if(!$ldap->success()){ + $messages[] = sprintf(_("The given filter '%s' for entry %s seems to be invalid!"), + bold($entry['filter']), $nr); + } } } @@ -198,7 +208,7 @@ class DynamicLdapGroup extends plugin 'base' => 'ldap:///'.$this->dn, 'attr' => 'memberUid', 'scope' => 2, - 'filter' => 'objectClass=posixGroup'); + 'filter' => '(objectClass=posixGroup)'); } // Remove a labeled Uri and get posts -- 2.30.2