X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-plugins%2Ffai%2Fadmin%2Ffai%2Fclass_faiScript.inc;h=17cd0734488bedbef6dd95be8b76c0051bbcdc44;hb=ff3ef83f8dcb54659807a39f8513486b5c0badb0;hp=dc8359d929496a39098201dc74fc53dd58cdebf7;hpb=dc7547fdb80a615660085bd6fa7d168c727a59b6;p=gosa.git diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index dc8359d92..17cd07344 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -88,7 +88,7 @@ class faiScript extends plugin /* Check if we must decode some attributes */ if(in_array_ics($attrs,$this->sub64coded)){ - $var = base64_decode($var); + $var = postDecode($var); } /* check if this is a binary entry */ @@ -147,24 +147,23 @@ class faiScript extends plugin set_object_info($this->dn); } - /* File download requested */ - if(isset($_GET['getFAIscript'])){ - if(isset($this->SubObjects[base64_decode($_GET['getFAIscript'])])){ - $obj = $this->SubObjects[base64_decode($_GET['getFAIscript'])]; - $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); - send_binary_content(stripslashes($obj['FAIscript']),$obj['cn'].".FAIscript"); - } - } - /* Handle posts */ $s_action = $s_entry = ""; foreach($_POST as $name => $value){ + if(preg_match("/^download_/",$name)){ + $s_entry = postDecode(preg_replace("/^download_/","",$name)); + $obj = $this->SubObjects[$s_entry]; + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + send_binary_content(stripslashes($obj['FAIscript']),$obj['cn'].".FAIscript"); + break; + } + /* Edit script posted */ if(preg_match("/^editscript_/",$name)){ $s_action = "edit"; $s_entry = preg_replace("/^editscript_/","",$name); - $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); + $s_entry = postDecode(preg_replace("/_.*/","",$s_entry)); break; } @@ -172,13 +171,13 @@ class faiScript extends plugin if(preg_match("/^deletescript_/",$name) && !preg_match("/freeze/i",$this->FAIstate)){ $s_action = "remove"; $s_entry = preg_replace("/^deletescript_/","",$name); - $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); + $s_entry = postDecode(preg_replace("/_.*/","",$s_entry)); break; } } if(isset($_GET['act']) && $_GET['act'] == "edit" && isset($_GET['id'])){ - $s_entry = base64_decode($_GET['id']); + $s_entry = postDecode($_GET['id']); if(isset($this->SubObjects[$s_entry])){ $s_action = "edit"; } @@ -311,9 +310,9 @@ class faiScript extends plugin $plug = $_GET['plug']; if($this->sort_order == "up"){ - $dir = "\/"; + $dir = image('images/lists/sort-up.png'); }else{ - $dir = "/\"; + $dir = image('images/lists/sort-down.png'); } if($this->sort_by == "name"){ @@ -324,7 +323,7 @@ class faiScript extends plugin $sort_prio = $dir; } - $divlist->SetHeader(array( array("string"=>""._("Name").$sort_name.""), + $divlist->SetHeader(array( array("string"=>""._("Name")."".$sort_name), array("string"=>"".$sort_prio._("Priority")."", "attach"=>"style='width:100px;'"), array("string"=>_("Download"), @@ -341,11 +340,11 @@ class faiScript 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()); } } @@ -354,18 +353,16 @@ class faiScript 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)); } /* Check if we are allowed to view this object */ $s_acl = $this->ui->get_permissions($dn,"fai/faiScriptEntry","cn") ; if(preg_match("/r/",$s_acl)){ - $divlist->AddEntry(array( array("string"=>"".$name['name'].""), + $divlist->AddEntry(array( array("string"=>"".$name['name'].""), array("string"=>$name['FAIpriority'] , "attach" => "style='width:100px;'"), array("string"=>$down , "attach" => "style='width:100px;'"), - array("string"=>str_replace("%s",base64_encode($key),$act), + array("string"=>str_replace("%s",postEncode($key),$act), "attach"=>"style='border-right: 0px;width:100px;text-align:right;'"))); } } @@ -531,7 +528,7 @@ class faiScript extends plugin foreach($Objects as $name => $obj){ foreach($this->sub64coded as $codeIt){ - $obj[$codeIt]=base64_encode(stripslashes($obj[$codeIt])); + $obj[$codeIt]=postEncode(stripslashes($obj[$codeIt])); } $tmp = array();