X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-plugins%2Ffai%2Fadmin%2Ffai%2Fclass_faiScript.inc;h=2703ae7219a1bc6b6f793396f920c84f7922642e;hb=89f67cee6e7bd74cbc0f1d489d573b8101d48ac3;hp=eb313dd9680a395cddc490d65df6bf7d606d45db;hpb=b706711fa91d20457d9cce39bb6d8e9a961be909;p=gosa.git diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index eb313dd96..2703ae721 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -72,21 +72,28 @@ class faiScript extends plugin $this->ui = get_userinfo(); - $this->scriptListWidget= new sortableListing($this->SubObjects, $this->convertList()); + $this->scriptListWidget= new sortableListing($this->convertList(TRUE), $this->convertList()); $this->scriptListWidget->setDeleteable(true); $this->scriptListWidget->setInstantDelete(false); $this->scriptListWidget->setEditable(true); $this->scriptListWidget->setWidth("100%"); - $this->scriptListWidget->setHeight("70px"); + $this->scriptListWidget->setHeight("140px"); $this->scriptListWidget->setHeader(array(_("Name"),_("Description"))); } - function convertList() + + function convertList($type = FALSE) { $data = array(); + $s_acl = $this->ui->get_permissions($this->dn,"fai/faiScriptEntry","FAIscript"); foreach($this->SubObjects as $cn => $entry){ if($entry['status'] == "delete") continue; - $data[$cn] = array('data' => array($entry['cn'], $entry['description'])); + if($type){ + $data[$cn] = $entry; + }else{ + if(!isset($entry['description'])) $entry['description']=""; + $data[$cn] = array('data' => array($entry['cn'], $entry['description'])); + } } return($data); } @@ -106,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 */ @@ -165,18 +172,6 @@ class faiScript extends plugin set_object_info($this->dn); } - /* 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; - } - } - $this->scriptListWidget->setAcl($this->getacl("")); $this->scriptListWidget->save_object(); $action = $this->scriptListWidget->getAction(); @@ -219,7 +214,8 @@ class faiScript extends plugin } } - /* Save the edited entry */ + + /* Save the edited entry */ if(isset($_POST['SaveSubObject'])){ /* Check if there are still errors remaining that must be fixed before saving */ @@ -280,9 +276,9 @@ class faiScript extends plugin return($display); } - $this->scriptListWidget->setListData($this->SubObjects, $this->convertList()); + $this->scriptListWidget->setListData($this->convertList(TRUE), $this->convertList()); $this->scriptListWidget->update(); - $smarty->assign("Entry_divlist",$this->scriptListWidget->render()); + $smarty->assign("Entry_listing",$this->scriptListWidget->render()); /* Magic quotes GPC, escapes every ' " \, to solve some security risks * If we post the escaped strings they will be escaped again @@ -444,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();