From: hickert Date: Tue, 30 Mar 2010 14:24:15 +0000 (+0000) Subject: Updated templates X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=711ca6a8d45760b58943a69f6962463e0640725a;p=gosa.git Updated templates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17402 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index 22aa7889f..71b9770b6 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -432,7 +432,7 @@ class faiPackage extends plugin /* Get description */ $description = " "; if(isset($this->list[$usedName]['DESCRIPTION'])){ - $description = postDecode($this->list[$usedName]['DESCRIPTION']); + $description = base64_decode($this->list[$usedName]['DESCRIPTION']); } if(!preg_match('/^freeze/', $this->FAIstate) && $this->acl_is_writeable("FAIpackage")){ diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index 2087089f4..fe760476c 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -838,7 +838,7 @@ class faiPartitionTable extends plugin /* Check if we must decode some attributes */ if(in_array_ics($attrs,$this->sub64coded)){ - $var = postDecode($var); + $var = base64_decode($var); } /* check if this is a binary entry */ diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 750d1d77c..a311eb140 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -113,7 +113,7 @@ class faiScript extends plugin /* Check if we must decode some attributes */ if(in_array_ics($attrs,$this->sub64coded)){ - $var = postDecode($var); + $var = base64_decode($var); } /* check if this is a binary entry */ @@ -440,7 +440,7 @@ class faiScript extends plugin foreach($Objects as $name => $obj){ foreach($this->sub64coded as $codeIt){ - $obj[$codeIt]=postEncode(stripslashes($obj[$codeIt])); + $obj[$codeIt]=base64_encode(stripslashes($obj[$codeIt])); } $tmp = array(); diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc index 1a46f050d..382165324 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc @@ -120,7 +120,7 @@ class faiTemplate extends plugin if(preg_match("/^editscript_/",$name)&&($once)){ $once = false; $entry = preg_replace("/^editscript_/","",$name); - $entry = base64_decode(preg_replace("/_.*/","",$entry)); + $entry = postDecode(preg_replace("/^editscript_/","",$name)); $obj = $this->SubObjects[$entry]; $acl_dn = $this->acl_base_for_current_object($obj['dn']); @@ -142,7 +142,7 @@ class faiTemplate extends plugin if(preg_match("/^deletescript_/",$name)&&($once) && !preg_match("/freeze/",$this->FAIstate)){ $once = false; $entry = preg_replace("/^deletescript_/","",$name); - $entry = base64_decode(preg_replace("/_.*/","",$entry)); + $entry = postDecode(preg_replace("/^deletescript_/","",$name)); $obj = $this->SubObjects[$entry]; $acl_dn = $this->acl_base_for_current_object($obj['dn']); @@ -156,15 +156,18 @@ class faiTemplate extends plugin } } } - } - /* File download requested */ - if(isset($_GET['getFAItemplate'])){ - if(isset($this->SubObjects[$_GET['getFAItemplate']])){ - $obj = $this->SubObjects[$_GET['getFAItemplate']]; + if(preg_match("/^download_/",$name)&&($once) && !preg_match("/freeze/",$this->FAIstate)){ + $once = false; + $entry = postDecode(preg_replace("/^download_/","",$name)); + $obj = $this->SubObjects[$entry]; $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); - send_binary_content($obj['FAItemplateFile'],$obj['cn'].".FAItemplate"); - } + if(!isset($obj['cn'])){ + trigger_error("Something wen't wrong here!"); + }else{ + send_binary_content($obj['FAItemplateFile'],$obj['cn'].".FAItemplate"); + } + } } /* Edit entries via GET */ @@ -283,11 +286,11 @@ class faiTemplate extends plugin /* Hide delete icon if this object is freezed */ if(preg_match("/freeze/",$this->FAIstate)){ - $act .= ""; + $act .= image('images/lists/edit.png','editscript_%s', msgPool::editButton()); }else{ - $act .= ""; + $act .= image('images/lists/edit.png','editscript_%s', msgPool::editButton()); if(preg_match("/d/",$acl)){ - $act .=""; + $act .= image('images/lists/trash.png','deletescript_%s', msgPool::delButton()); } } @@ -296,9 +299,7 @@ class faiTemplate extends plugin if(($this->SubObjects[$key]['status'] == "new") || ($this->SubObjects[$key]['dn'] == "new") || !preg_match("/r/",$s_acl)){ $down = ""; }else{ - $down = " - "._("Download")." - "; + $down = image('images/save.png','download_'.postEncode($key), _("Download")); } /* Check if we are allowed to view this object */ @@ -308,7 +309,7 @@ class faiTemplate extends plugin $edit_link = "".$tmp[$key].""; $divlist->AddEntry(array( array("string"=> $edit_link), array("string"=>$down , "attach" => "style='width:20px;'"), - array("string"=>str_replace("%s",base64_encode($key),$act), + array("string"=>str_replace("%s",postEncode($key),$act), "attach"=>"style='border-right: 0px;width:50px;text-align:right;'"))); } }