Code

Prevent multiple categories of the same type in userFilterEditor
[gosa.git] / gosa-core / include / class_userFilterEditor.inc
index f51e3499b3923c758cd710abfbed760e11e540aa..3cdbc6f2c69843eccb4ee054ee49564ede316376 100644 (file)
@@ -21,7 +21,8 @@ class userFilterEditor extends plugin
   // The list of all categories mangaged by the current filter object.
   // Used in the grop-down box.
   public $orig_name = "";
-  
+
+  public $backends = array('LDAP', 'SYSTEMS', 'FAI', 'GroupLDAP','ACL');  
 
 
   /*! \brief    Instantiate the filter editing dialog. 
@@ -131,6 +132,7 @@ class userFilterEditor extends plugin
 
     $smarty->assign("fixedFilters", array_keys($filter->searches));
     $smarty->assign('parent', $this->parent);
+    $smarty->assign('backends', $this->backends);
     $smarty->assign('name', htmlentities($this->name,ENT_COMPAT,'UTF-8'));
     $smarty->assign('queries', $queries);
     $smarty->assign('share', $this->share);
@@ -186,6 +188,7 @@ class userFilterEditor extends plugin
         }elseif(isset($_POST['availableCategory']) && !empty($_POST['availableCategory'])){
           $this->selectedCategories[] = get_post('availableCategory');
         }
+        $this->selectedCategories = array_unique($this->selectedCategories);
       }
 
       // Remove categories