Code

Updated serverService : Set acl base/category for services
[gosa.git] / plugins / admin / systems / class_servNfs.inc
index 113675920841129b34ff9b74a275b11f87138f09..fbda973248ad639c51ae553444f6d94f1c2d8876 100644 (file)
@@ -32,7 +32,7 @@ class servnfs extends plugin
   {
     plugin::plugin ($config, $dn);
     
-    $this->types   = array("NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP");
+    $this->types   = array("CIFS" => "CIFS", "NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP");
     if($dn){
       $this->host = substr($dn, 3, strpos($dn, ',')-3);
     }
@@ -71,10 +71,11 @@ class servnfs extends plugin
       list($this->name, $this->description, $this->type, $this->charset,
            $this->path, $this->option, $this->volume)= split("\|",$entry."|");
       $this->is_edit          = true;
-      
+
     }else{
       $this->attributes[] = "name";
     }
+
     
     $this->create_mount_init = $mount;
   }
@@ -181,7 +182,7 @@ class servnfs extends plugin
 
     // only 0-9a-z
     if(!$this->is_edit){
-      if(preg_match("/[^a-z0-9\.\-_]/i",$this->name)){
+      if(!preg_match("/^[a-z0-9\.\-_]+$/i",$this->name)){
         $message[]=_("Please specify a valid name for your share.");
       }
       if(empty($this->name)){
@@ -189,11 +190,11 @@ class servnfs extends plugin
       }
     }
 
-    if(preg_match("/\|/",$this->description)){
+    if(preg_match("/[^a-z0-9._+ \|-]+/i",$this->description)){
       $message[]=_("Description contains invalid characters.");
     }
 
-    if(preg_match("/\|/",$this->volume)){
+    if(preg_match("/[^a-z0-9._+ |-]/i",$this->volume)){
       $message[]=_("Volume contains invalid characters.");
     }
   
@@ -201,7 +202,7 @@ class servnfs extends plugin
       $message[]=_("Path contains invalid characters.");
     }
 
-    if(preg_match("/\|/",$this->option)){
+    if(preg_match("/[^a-z0-9._+ \|-]/i",$this->option)){
       $message[]=_("Option contains invalid characters.");
     }
 
@@ -273,7 +274,7 @@ class servnfs extends plugin
               "charset"     => _("Charset"),
               "path"        => _("Path"),
               "option"      => _("Option"), 
-              "volume"      => _("Valume"))
+              "volume"      => _("Volume"))
             ));
   }
 }