Code

Updated FAItemplate handling, do not mess around with path and file
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Nov 2008 13:48:47 +0000 (13:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Nov 2008 13:48:47 +0000 (13:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12894 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc
gosa-plugins/fai/admin/fai/faiTemplateEntry.tpl

index c784a6e164396a848a6da539ce7f103451818254..1dfb7e0901151e5298326ead6bee7c4ded9e32e1 100644 (file)
@@ -126,14 +126,12 @@ class faiTemplateEntry extends plugin
       }
     }
 
-    $smarty->assign("FAItemplateFile","");
-
     foreach($this->attributes as $attr){
       $smarty->assign($attr."ACL",$this->getacl($attr,preg_match("/freeze/",$this->FAIstate)));
     }
 
     /* We now split cn/FAItemplatePath to make things more clear... */
-    $smarty->assign("cn", basename($this->FAItemplatePath));
+    $smarty->assign("templateFile", basename($this->FAItemplatePath));
     $smarty->assign("templatePath", dirname($this->FAItemplatePath));
     $smarty->assign("freeze", preg_match("/freeze/i",$this->FAIstate));;
 
@@ -182,15 +180,15 @@ class faiTemplateEntry extends plugin
       /* Check if we are allowed to change the destination directory 
        */
       if($this->acl_is_writeable("FAItemplatePath")){
-        $cur_path = $this->FAItemplatePath.'/'.basename($cur_path);
+        $cur_path = get_post('templatePath').'/'.basename($cur_path);
       }
 
       /* Check if we are allowed to change the destination directory 
        */
       if($this->acl_is_writeable("cn")){
-        $cur_path = dirname($cur_path).'/'.$this->cn;
+        $cur_path = dirname($cur_path).'/'.get_post('templateFile');
       }
-      $this->FAItemplatePath = $cur_path;
+      $this->FAItemplatePath = $this->cn= $cur_path;
     }
   }
 
@@ -244,7 +242,6 @@ class faiTemplateEntry extends plugin
       $tmp[$attrs] = $this->$attrs;
     }
 
-    $tmp['cn']      = $this->FAItemplatePath;
     if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){
       $tmp['remove']['from']  = $this->orig_cn;
       $tmp['remove']['to']    = $tmp['cn'];
index 58d3569b03ee37183119fc6a7b3aa1be9230704a..4e468e66c1a9630b7e3fcb7527a8d9bffa830c14 100644 (file)
@@ -11,7 +11,7 @@
                    </td>
                    <td>
 {render acl=$cnACL}
-               <input value="{$cn}" name="cn" size="45" maxlength="80">&nbsp;&nbsp;
+               <input value="{$templateFile}" name="templateFile" size="45" maxlength="80">&nbsp;&nbsp;
 {/render}
                    </td>
                   </tr>
@@ -23,7 +23,7 @@
                                </td>
                        <td>
 {render acl=$FAItemplatePathACL}
-                               <input type="text" name="FAItemplatePath" value="{$templatePath}" id="templatePath" size="45">
+                               <input type="text" name="templatePath" value="{$templatePath}" id="templatePath" size="45">
 {/render}
                                </td>
                  </tr>