Code

Fixed FAI release creation.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 18 Apr 2008 11:53:31 +0000 (11:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 18 Apr 2008 11:53:31 +0000 (11:53 +0000)
-Fixed name checks, to avoid creation of releases with '/' in their name.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10555 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiManagement.inc

index e1b123ad205853aea52852537341352656e1f658..6517971311d0418cb81939b2860018aff6f74edc 100644 (file)
@@ -528,8 +528,8 @@ class faiManagement extends plugin
       $base= $this->fai_base;
 
       /* Check used characters */
-      if(preg_match("/[^0-9a-z \ö\ä\ü\.-_:,]/i",$name)){
-        msg_dialog::display(_("Error"), msgPool::invalid(_("Name"),$name,"/[0-9a-z \ö\ä\ü\.-_:,]/i"), ERROR_DIALOG);
+      if(!preg_match("/^[0-9a-z \ö\ä\ü\.\-_:,]*$/i",$name)){
+        msg_dialog::display(_("Error"), msgPool::invalid(_("Name"),$name,"/[0-9a-z \ö\ä\ü\.\-_:,]/i"), ERROR_DIALOG);
         $is_ok = false;
       }
 
@@ -719,7 +719,7 @@ class faiManagement extends plugin
     if("" != $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'))){
       if(($s_action == "freeze_branch")||($this->dispNewFreeze)){
         if(!$this->acl_is_createable()){
-        msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG);
+          msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG);
         }else{
           $this->dispNewFreeze = true;
           $smarty->assign("iframe",false);