From 6b601013730d1fca352bff1e13a7f41eeb93ae6f Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Oct 2005 12:06:02 +0000 Subject: [PATCH] removed description *must git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1466 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiScript.inc | 11 +++++++++-- plugins/admin/fai/class_faiScriptEntry.inc | 4 ---- plugins/admin/fai/faiScript.tpl | 4 ++-- plugins/admin/fai/faiScriptEntry.tpl | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 8e4513d7f..e3ee13884 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -159,7 +159,11 @@ class faiScript extends plugin $a_return=array(); foreach($this->SubObjects as $obj){ if($obj['status'] != "delete"){ - $a_return[$obj['cn']]= $obj['cn']." [".$obj['description']."]"; + if((isset($obj['description']))&&(!empty($obj['description']))){ + $a_return[$obj['cn']]= $obj['cn']." [".$obj['description']."]"; + }else{ + $a_return[$obj['cn']]= $obj['cn']; + } } } return($a_return); @@ -194,7 +198,7 @@ class faiScript extends plugin { $message= array(); $str = utf8_encode("üöä"); - if((empty($this->description))||(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description))){ + if(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description)){ $message[]=_("Please enter a valid description."); } return ($message); @@ -266,6 +270,9 @@ class faiScript extends plugin $ldap->modify($tmp); $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ + if($tmp['description']==array()){ + unset($tmp['description']); + } $ldap->cd($this->config->current['BASE']); $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); $ldap->cd($sub_dn); diff --git a/plugins/admin/fai/class_faiScriptEntry.inc b/plugins/admin/fai/class_faiScriptEntry.inc index 903230055..ebaf792f4 100644 --- a/plugins/admin/fai/class_faiScriptEntry.inc +++ b/plugins/admin/fai/class_faiScriptEntry.inc @@ -94,10 +94,6 @@ class faiScriptEntry extends plugin $message[]=_("Please specify a script."); } - if(empty($this->Object_description)){ - $message[] = _("Please enter a description."); - } - if(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->Object_description)){ $message[] = _("Invalid character in description. Please enter a valid description."); } diff --git a/plugins/admin/fai/faiScript.tpl b/plugins/admin/fai/faiScript.tpl index 23345a416..7896626c7 100644 --- a/plugins/admin/fai/faiScript.tpl +++ b/plugins/admin/fai/faiScript.tpl @@ -6,7 +6,7 @@ @@ -16,7 +16,7 @@ diff --git a/plugins/admin/fai/faiScriptEntry.tpl b/plugins/admin/fai/faiScriptEntry.tpl index a410994a4..7f6b7ada0 100644 --- a/plugins/admin/fai/faiScriptEntry.tpl +++ b/plugins/admin/fai/faiScriptEntry.tpl @@ -14,7 +14,7 @@ - {t}Description{/t}{$must}  + {t}Description{/t}  -- 2.30.2