From: hickert Date: Wed, 15 Oct 2008 14:01:34 +0000 (+0000) Subject: Updated some FAI plugins X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2a4adfb761b386591be1afd5f78df715def70d9e;p=gosa.git Updated some FAI plugins -Testet HTML Posts && ACLs. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12712 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc index 6778811fb..5753521c6 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHook.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHook.inc @@ -418,11 +418,6 @@ class faiHook extends plugin { if((isset($_POST['FAIhook_posted'])) && !preg_match("/^freeze/", $this->FAIstate)){ plugin::save_object(); - foreach($this->attributes as $attrs){ - if(isset($_POST[$attrs])){ - $this->$attrs = $_POST[$attrs]; - } - } } } diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 2488e4c54..7a480bbea 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -451,11 +451,6 @@ class faiScript extends plugin { if((isset($_POST['FAIscript_posted'])) && !preg_match("/freeze/", $this->FAIstate)){ plugin::save_object(); - foreach($this->attributes as $attrs){ - if(isset($_POST[$attrs])){ - $this->$attrs = $_POST[$attrs]; - } - } } /* Get sort order */ diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc index b71bf4bce..84e578b0b 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc @@ -147,6 +147,10 @@ class faiTemplateEntry extends plugin /* Check if form is posted and we are not freezed */ if((isset($_POST['SubObjectFormSubmitted'])) && !preg_match("/freeze/", $this->FAIstate)){ + /* Remember destination current path + depending on the ACLs we will assemble a new one later. + */ + $cur_path = $this->FAItemplatePath; plugin::save_object(); /* Set user.group (FAIowner) attribute */ @@ -173,11 +177,20 @@ class faiTemplateEntry extends plugin $tmode= $tmode.$dest; } $this->FAImode= $tmode; + } + + /* Check if we are allowed to change the destination directory + */ + if($this->acl_is_writeable("FAItemplatePath")){ + $cur_path = $this->FAItemplatePath.'/'.basename($cur_path); + } - /* Assemble cn/FAItemplatePath */ - $this->cn= preg_replace('/\/+/', '/', $this->FAItemplatePath.'/'.$this->cn); - $this->FAItemplatePath= $this->cn; + /* Check if we are allowed to change the destination directory + */ + if($this->acl_is_writeable("cn")){ + $cur_path = dirname($cur_path).'/'.$this->cn; } + $this->FAItemplatePath = $cur_path; } } diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc index 7c7f3f69a..40ece1325 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -276,11 +276,6 @@ class faiVariable extends plugin { if((isset($_POST['FAIvariable_posted'])) && !preg_match("/freeze/", $this->FAIstate) ){ plugin::save_object(); - foreach($this->attributes as $attrs){ - if(isset($_POST[$attrs])){ - $this->$attrs = $_POST[$attrs]; - } - } } }