Code

Updated bracket detection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Jun 2010 13:54:38 +0000 (13:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Jun 2010 13:54:38 +0000 (13:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18824 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/addons/dyngroup/classDynamicLdapGroup.inc

index 6fcf63bb416f8dd6340bba7058d83c285d505c72..d56e85acea5fd06c37b015ee367d024ff0b7a645 100644 (file)
@@ -124,6 +124,8 @@ class DynamicLdapGroup extends plugin
             // A filter is required
             if(empty($entry['filter'])){
                 $messages[] = msgPool::required(_("Filter")." {$nr}");
+            }elseif(!preg_match("/^\(/", $entry['filter'])){
+                $messages[] = msgPool::invalid(_("Filter")." {$nr}",  $entry['filter'],'', '(objectClass=gosaAccount)'." - "._("Surrounding brakets are required!"));
             }else{
 
                 // Check if filter is valid
@@ -241,7 +243,6 @@ class DynamicLdapGroup extends plugin
         foreach($this->labeledURIparsed as $entry){
             $scope = $this->scopes[$entry['scope']];
             $filter = $entry['filter'];
-            $filter = '('.trim($filter, '() ').')';
             $this->labeledURI[] = "{$entry['base']}?{$entry['attr']}?{$scope}?{$filter}";
         }
         $this->labeledURI = array_unique($this->labeledURI);