summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 851192b)
raw | patch | inline | side by side (parent: 851192b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Oct 2005 08:22:36 +0000 (08:22 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Oct 2005 08:22:36 +0000 (08:22 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1634 594d385d-05f5-0310-b6e9-bd551577e9d8
index a6a5d7050e7a7bf34f97cc5b6bd515982009d2da..c73378620babce208e4aace2fca6b2736d1f88cf 100644 (file)
*/
function save_object()
{
- plugin::save_object();
- foreach($this->attributes as $attrs){
- if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
+ if(isset($_POST['FAIhook_posted'])){
+ plugin::save_object();
+ foreach($this->attributes as $attrs){
+ if(isset($_POST[$attrs])){
+ $this->$attrs = $_POST[$attrs];
+ }
}
}
}
index 5e28e38982861eb5593c4f98837d45b37ac322dc..1ab8d6c1a9b2c95c45abfd4928badffd2f2da7ef 100644 (file)
/* attribute list for save action */
var $ignore_account= TRUE;
- var $attributes = array("Object_cn","Object_description","Object_FAIscript","Object_FAItask");
+ var $attributes = array("cn","description","FAIscript","FAItask");
var $objectclasses= array();
var $orig_cn = "";
var $tasks = array("chboot", "configure", "debconf", "extrbase", "faiend", "finish",
"install", "instsoft", "mirror", "mountdisks", "partition", "prepareapt",
"savelog", "softupdate", "sysinfo"," updatebase");
- var $Object_dn = "";
- var $Object_cn = "";
- var $Object_FAItask = "";
- var $Object_FAIscript = "";
- var $Object_description = "";
- var $Object_status = "new";
+ var $dn = "";
+ var $cn = "";
+ var $FAItask = "";
+ var $FAIscript = "";
+ var $description = "";
+ var $status = "new";
function faiHookEntry ($config, $dn= NULL,$object=false)
{
$this->orig_cn= $object['cn'];
$this->dn=$object['dn'];
foreach($object as $name=>$value){
- $oname = "Object_".$name;
+ $oname = $name;
$this->$oname=$value;
}
}else{
- $this->Object_status = "new";
+ $this->status = "new";
$this->orig_cn = false;
}
}
print_red(_("Selected file is empty."));
}else{
$str = utf8_encode(file_get_contents($_FILES['ImportFile']['tmp_name']));
- $this->Object_FAIscript = $str;
+ $this->FAIscript = $str;
}
}
$smarty->assign("tasks", $this->tasks);
function check()
{
$message= array();
- if(empty($this->Object_FAIscript)) {
+ if(empty($this->FAIscript)) {
$message[]=_("Please enter a value for script.");
}
- if(empty($this->Object_cn)){
+ if(empty($this->cn)){
$message[] = _("Please enter a name.");
}
- if(preg_match("/[^0-9a-z]/i",$this->Object_cn)){
+ if(preg_match("/[^0-9a-z]/i",$this->cn)){
$message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed.");
}
{
$tmp=array();
foreach($this->attributes as $attrs){
- $attr = preg_replace("/^Object_/","",$attrs);
- $tmp[$attr] = $this->$attrs;
+ $tmp[$attrs] = $this->$attrs;
}
if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){
}
$tmp['dn'] = $this->dn;
- $tmp['status'] = $this->Object_status;
+ $tmp['status'] = $this->status;
return($tmp);
}
}
index bd5790c06d6ba1fae50c864b22d4e7a53e7283d4..484cad55902d4fce3f1895d40f90f33e497b684d 100644 (file)
</td>
</tr>
</table>
+<input type="hidden" value="1" name="FAIhook_posted">
index 1af7c5a638c1fed88294529449bacbda3cebac42..e6ebbd8a85b723200506c7b53a32da92febd6b30 100644 (file)
{t}Name{/t}{$must}
</td>
<td>
- <input value="{$Object_cn}" name="Object_cn">
+ <input value="{$cn}" name="cn">
</td>
</tr>
<tr>
{t}Description{/t}
</td>
<td>
- <input value="{$Object_description}" name="Object_description">
+ <input value="{$description}" name="description">
</td>
</tr>
</table>
<table width="100%">
<tr>
<td>
- <LABEL for="Object_FAItask">
+ <LABEL for="FAItask">
{t}Task{/t}
</LABEL>
- <select name="Object_FAItask" title="{t}Choose a FAI task to hook{/t}">
- {html_options values=$tasks output=$tasks selected=$Object_FAItask}
+ <select name="FAItask" title="{t}Choose a FAI task to hook{/t}">
+ {html_options values=$tasks output=$tasks selected=$FAItask}
</select>
</td>
</tr>
<p class="seperator"> </p>
<h2><img alt="" src="images/fai_hook.png" align="middle" title="{t}Hook attributes{/t}">
- <LABEL for="Object_FAIscript">
+ <LABEL for="FAIscript">
{t}Script{/t}
</LABEL>
</h2>
<table width="99%">
<tr>
<td>
- <textarea name="Object_FAIscript" style="width:100%;height:300px;" id="Object_FAIscript">{$Object_FAIscript}</textarea>
+ <textarea name="FAIscript" style="width:100%;height:300px;" id="FAIscript">{$FAIscript}</textarea>
</td>
</tr>
</table>