Code

Added check for duplicated entries
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Dec 2005 13:16:15 +0000 (13:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Dec 2005 13:16:15 +0000 (13:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2250 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupApplication.inc

index f11234051cd997648294d38edb8593b8517a15a5..ad21edb52d877ea5b2e8fda65d35af68276831f9 100644 (file)
@@ -209,12 +209,21 @@ class appgroup extends plugin
     }
 
 
-    /* Add Categorie */
+    /* Add Categorie */ 
+  
+    
     if((isset($_POST['AddCat']))&&(isset($_POST['CatName']))&&(!empty($_POST['CatName']))){
-      if(empty($this->curCatDir)){
-        $this->Categories[$_POST['CatName']]=$_POST['CatName'];
+      
+      if(preg_match("/[^0-9a-z,\.-;:_#\+\- ]/i",$_POST['CatName'])){
+        print_red(_("Invalid character in category name."));
+      }elseif(!in_array($_POST['CatName'],$this->Categories)){ 
+        if(empty($this->curCatDir)){
+          $this->Categories[$_POST['CatName']]=$_POST['CatName'];
+        }else{
+          $this->Categories[$this->curCatDir."/".$_POST['CatName']]=$_POST['CatName'];
+        }
       }else{
-        $this->Categories[$this->curCatDir."/".$_POST['CatName']]=$_POST['CatName'];
+        print_red(_("The specified category already exists."));
       }
     }