diff --git a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc
index 91c04d67bfba5905f459772c6d4c756ed264bb56..a0ba363c99bb006685447226502687eefeee6e2c 100644 (file)
function faiScriptEntry (&$config, $dn= NULL,$object=false)
{
function faiScriptEntry (&$config, $dn= NULL,$object=false)
{
- plugin::plugin ($config, $dn);
+ plugin::plugin ($config, NULL);
if($dn != "new"){
$this->orig_cn= $object['cn'];
$this->dn=$object['dn'];
if($dn != "new"){
$this->orig_cn= $object['cn'];
$this->dn=$object['dn'];
}
/* File download requested */
}
/* File download requested */
- if(isset($_GET['getFAIScript'])){
+ if(isset($_POST['download'])){
send_binary_content(stripslashes($this->FAIscript),$this->cn.".FAIscript");
}
/* Create download button*/
if($this->dn != "new" && $this->acl_is_readable("FAIscript")){
send_binary_content(stripslashes($this->FAIscript),$this->cn.".FAIscript");
}
/* Create download button*/
if($this->dn != "new" && $this->acl_is_readable("FAIscript")){
- $smarty->assign("DownMe","<a href='?plug=".$_GET['plug']."&getFAIScript'>
- <img src='images/save.png' alt='"._("Download")."' title='"._("Download")."' border=0 class='center'>
- </a>");
+ $smarty->assign("DownMe", image('images/save.png','download',_("Download")));
}else{
$smarty->assign("DownMe","");
}
}else{
$smarty->assign("DownMe","");
}
$message[] = msgPool::duplicated(_("Name"));
}
$message[] = msgPool::duplicated(_("Name"));
}
- if(empty($this->cn)){
+ $c = trim($this->cn);
+ if($c == ""){
$message[] = msgPool::required(_("Name"));
}
$message[] = msgPool::required(_("Name"));
}
+ if(preg_match("/[^a-z0-9_\-]/i",$c)){
+ $message[] = msgPool::invalid(_("Name"),$c,"/[a-z0-9_\-]/i");
+ }
- if(empty($this->FAIscript)){
+ $s = trim($this->FAIscript);
+ if($s == ""){
$message[]= msgPool::required(_("Script"));
}
$message[]= msgPool::required(_("Script"));
}