Code

Allow the specification of hidden shares (indicated
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Sep 2009 09:24:49 +0000 (09:24 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Sep 2009 09:24:49 +0000 (09:24 +0000)
by a $ _at the end_ of the share name) by relaxing the
check weither a share name is valid or not
(Trac: #1960)

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@14383 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc

index 4e4f7238eb9cba5e0661d909468ec1225af1571a..6540df2c44b256833c5fb6c49c8cdf91bd51e5d0 100644 (file)
@@ -198,8 +198,13 @@ class servnfs extends plugin
       if(empty($this->name)){
         $message[]= msgPool::required(_("Name"));
       }
-      if(!preg_match("/^[a-z0-9\._äüö]*$/ui",$this->name)){
-        $message[]= msgPool::invalid(_("Name"),$this->name,"/[a-z0-9\._äüö]/ui");
+      if(!preg_match("/^[a-z0-9\._äüö\$]*$/ui",$this->name)){
+        $message[]= msgPool::invalid(_("Name"),$this->name,"/[a-z0-9\._äüö]\$/ui");
+      }
+      else {
+        if (!preg_match("/^[^\$].*\$$/", $this->name)) {
+          $message[] = _("Hidden shares must have the '$' at the end of the name!");
+        }
       }
     }