diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc
index eb313dd9680a395cddc490d65df6bf7d606d45db..2703ae7219a1bc6b6f793396f920c84f7922642e 100644 (file)
$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);
}
/* 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 */
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();
}
}
- /* 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 */
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
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();