From: hickert Date: Thu, 20 Oct 2005 08:18:39 +0000 (+0000) Subject: Removed Object_ from Variable Entries X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=851192b4785f3f2644b21967fcf4a3ad4ede61e2;p=gosa.git Removed Object_ from Variable Entries git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1633 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiVariable.inc b/plugins/admin/fai/class_faiVariable.inc index d2e74c469..7d4f8fb62 100644 --- a/plugins/admin/fai/class_faiVariable.inc +++ b/plugins/admin/fai/class_faiVariable.inc @@ -201,10 +201,12 @@ class faiVariable extends plugin */ function save_object() { - plugin::save_object(); - foreach($this->attributes as $attrs){ - if(isset($_POST[$attrs])){ - $this->$attrs = $_POST[$attrs]; + if(isset($_POST['FAIvariable_posted'])){ + plugin::save_object(); + foreach($this->attributes as $attrs){ + if(isset($_POST[$attrs])){ + $this->$attrs = $_POST[$attrs]; + } } } } diff --git a/plugins/admin/fai/class_faiVariableEntry.inc b/plugins/admin/fai/class_faiVariableEntry.inc index fa4bd2e5b..ac2317065 100644 --- a/plugins/admin/fai/class_faiVariableEntry.inc +++ b/plugins/admin/fai/class_faiVariableEntry.inc @@ -9,15 +9,15 @@ class faiVariableEntry extends plugin /* attribute list for save action */ var $ignore_account= TRUE; - var $attributes = array("Object_cn","Object_description","Object_FAIvariableContent"); + var $attributes = array("cn","description","FAIvariableContent"); var $objectclasses= array(); var $orig_cn = ""; - var $Object_dn = ""; - var $Object_cn = ""; - var $Object_FAIvariableContent = ""; - var $Object_description = ""; - var $Object_status = "new"; + var $dn = ""; + var $cn = ""; + var $FAIvariableContent = ""; + var $description = ""; + var $status = "new"; function faiVariableEntry ($config, $dn= NULL,$object=false) { @@ -26,11 +26,11 @@ class faiVariableEntry extends plugin $this->orig_cn= $object['cn']; $this->dn=$object['dn']; foreach($object as $name=>$value){ - $oname = "Object_".$name; + $oname = $name; $this->$oname=addslashes($value); } }else{ - $this->Object_status = "new"; + $this->status = "new"; $this->orig_cn = false; } } @@ -75,15 +75,15 @@ class faiVariableEntry extends plugin { $message= array(); - if(empty($this->Object_FAIvariableContent)) { + if(empty($this->FAIvariableContent)) { $message[]=_("Please specify a value for the attribute 'content'."); } - 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."); } @@ -94,8 +94,7 @@ class faiVariableEntry extends plugin { $tmp=array(); foreach($this->attributes as $attrs){ - $attr = preg_replace("/^Object_/","",$attrs); - $tmp[$attr] = stripslashes( $this->$attrs); + $tmp[$attrs] = stripslashes( $this->$attrs); } if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){ @@ -104,7 +103,7 @@ class faiVariableEntry extends plugin } $tmp['dn'] = $this->dn; - $tmp['status'] = $this->Object_status; + $tmp['status'] = $this->status; return($tmp); } } diff --git a/plugins/admin/fai/faiVariable.tpl b/plugins/admin/fai/faiVariable.tpl index 066e2e897..54b1effb8 100644 --- a/plugins/admin/fai/faiVariable.tpl +++ b/plugins/admin/fai/faiVariable.tpl @@ -49,3 +49,4 @@ + diff --git a/plugins/admin/fai/faiVariableEntry.tpl b/plugins/admin/fai/faiVariableEntry.tpl index e1373771e..d7d41e1c1 100644 --- a/plugins/admin/fai/faiVariableEntry.tpl +++ b/plugins/admin/fai/faiVariableEntry.tpl @@ -9,7 +9,7 @@ {t}Name{/t}{$must}  - + @@ -17,7 +17,7 @@ {t}Description{/t}  - + @@ -35,7 +35,7 @@ - +