summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5f0a26d)
raw | patch | inline | side by side (parent: 5f0a26d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Oct 2005 08:04:04 +0000 (08:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Oct 2005 08:04:04 +0000 (08:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1631 594d385d-05f5-0310-b6e9-bd551577e9d8
index 57de6487616fb21044f49822a5f157f949d99f71..e2825064e8aac42a7f2b7b840857bb6833cfdb00 100644 (file)
*/
function save_object()
{
- plugin::save_object();
- foreach($this->attributes as $attrs){
- if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
+ if(isset($_POST['FAIscript_posted'])){
+ plugin::save_object();
+ foreach($this->attributes as $attrs){
+ if(isset($_POST[$attrs])){
+ $this->$attrs = $_POST[$attrs];
+ }
}
}
}
diff --git a/plugins/admin/fai/class_faiScriptEntry.inc b/plugins/admin/fai/class_faiScriptEntry.inc
index 1fb0239d9088aa3a47b1b1d011c65f719399a986..13d5bdb08b713edd778e5a7ea2b9d8d9b4917d69 100644 (file)
/* attribute list for save action */
var $ignore_account= TRUE;
- var $attributes = array("Object_cn","Object_description","Object_FAIpriority","Object_FAIscript");
+ var $attributes = array("cn","description","FAIpriority","FAIscript");
var $objectclasses= array();
var $orig_cn = "";
- var $Object_dn = "";
- var $Object_cn = "";
- var $Object_FAIpriority = "";
- var $Object_FAIscript = "";
- var $Object_description = "";
- var $Object_status = "new";
+ var $dn = "";
+ var $cn = "";
+ var $FAIpriority = "";
+ var $FAIscript = "";
+ var $description = "";
+ var $status = "new";
function faiScriptEntry ($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;
}
}
}
for($i =0 ; $i < 100 ; $i++){
- $Object_FAIprioritys[$i]=$i;
+ $FAIprioritys[$i]=$i;
}
- $smarty->assign("Object_FAIprioritys",$Object_FAIprioritys);
+ $smarty->assign("FAIprioritys",$FAIprioritys);
$display.= $smarty->fetch(get_template_path('faiScriptEntry.tpl', TRUE));
return($display);
}
{
$message= array();
- 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 7896626c7f0e3e344c1d87db8dd671d2544a5ff5..b100327e908422093b90c699400aef5e3509101a 100644 (file)
</td>
</tr>
</table>
+<input type="hidden" value="1" name="FAIscript_posted">
index 0017e6095012e2b3bb2d43019a4dc1c5887bcddb..5652244ecfc6db5f865ed097765a506e07112a88 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 size=40 value="{$Object_description}" name="Object_description">
+ <input size=40 value="{$description}" name="description">
</td>
</tr>
</table>
<table width="100%">
<tr>
<td>
- <LABEL for="Object_FAIpriority">
+ <LABEL for="FAIpriority">
{t}Priority{/t}
</LABEL>
</td>
<td>
- <select name="Object_FAIpriority" title="{t}Choose a priority{/t}" Object_FAIpriority>
- {html_options values=$Object_FAIprioritys output=$Object_FAIprioritys selected=$Object_FAIpriority}
+ <select name="FAIpriority" title="{t}Choose a priority{/t}">
+ {html_options values=$FAIprioritys output=$FAIprioritys selected=$FAIpriority}
</select>
</td>
</tr>
</table>
<p class="seperator"> </p>
<h2><img alt="" src="images/fai_script.png" align="middle" title="{t}Script 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>