index 8232a156005a1d189d7503ca4f881d74216a9984..244af77bde30cf836f0e256d61a0bf2e60e328b0 100644 (file)
"savelog", "softupdate", "sysinfo","updatebase");
var $dn = "";
var $cn = "";
- var $FAItask = "";
+ var $FAItask = "chboot";
var $FAIscript = "";
var $description = "";
var $status = "new";
+
+ var $FAIstate = "";
function faiHookEntry ($config, $dn= NULL,$object=false)
{
$oname = $name;
$this->$oname=$value;
}
- }else{
+
+ if(isset($this->attrs['FAIstate'][0])){
+ $this->FAIstate = $this->attrs['FAIstate'][0];
+ }
+
+ }elseif(is_array($object)){
if(count($object)){
$this->orig_cn= $object['cn'];
$this->dn=$object['dn'];
}
}
+ /* Create download button*/
+ if($this->dn != "new" && $this->acl_is_readable("FAIscript")){
+ $smarty->assign("DownMe","<a href='getFAIscript.php?id=".base64_encode($this->dn)."'>
+ <img src='images/save.png' alt='"._("Download")."' title='"._("Download")."' border=0 class='center'>
+ </a>");
+ }else{
+ $smarty->assign("DownMe","");
+ }
+
$used_tasks = $this->parent->getUsedFAItask($this->cn);
$tasks = $this->tasks;
foreach($this->tasks as $id => $task){
*/
foreach($this->attributes as $attrs){
if(get_magic_quotes_gpc()){
- $smarty->assign($attrs,htmlentities(stripslashes($this->$attrs)));
+ $smarty->assign($attrs,(stripslashes($this->$attrs)));
}else{
- $smarty->assign($attrs,htmlentities($this->$attrs));
+ $smarty->assign($attrs,($this->$attrs));
}
}
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translated){
+ $acl = $this->getacl($name);
+ if($this->FAIstate == "freezed"){
+ $acl = preg_replace("/w/","",$acl);
+ }
+ $smarty->assign($name."ACL",$acl);
+ }
+
$display.= $smarty->fetch(get_template_path('faiHookEntry.tpl', TRUE));
return($display);
}
/* Save data to object */
function save_object()
{
- if(isset($_POST['SubObjectFormSubmitted'])){
+ if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
foreach($this->attributes as $attrs){
- if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
- }else{
- $this->$attrs = "";
+ if($this->acl_is_writeable($attrs)){
+ if(isset($_POST[$attrs])){
+ $this->$attrs = $_POST[$attrs];
+ }else{
+ $this->$attrs = "";
+ }
}
}
}
/* Check supplied data */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
if(empty($this->FAIscript)) {
$message[]=_("Please enter a value for script.");
}
$tmp['status'] = $this->status;
return($tmp);
}
+
+ /* Return plugin informations for acl handling */
+ function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Hook entry"),
+ "plDescription" => _("FAI hook entry"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 21,
+ "plSection" => array("administration"),
+ "plCategory" => array("fai"),
+ "plProvidedAcls" => array(
+ "cn" => _("Name"),
+ "description" => _("Description"),
+ "FAItask" => _("Task"),
+ "FAIscript" => _("FAI script"))
+ ));
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>