From 6208304fac5da3d798972671e58357ff40efb795 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 22 Dec 2005 10:19:53 +0000 Subject: [PATCH] Added checks and initial clas vars git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2378 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDB.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/admin/systems/class_servDB.inc b/plugins/admin/systems/class_servDB.inc index 58b26e766..2ee9f873d 100644 --- a/plugins/admin/systems/class_servDB.inc +++ b/plugins/admin/systems/class_servDB.inc @@ -27,6 +27,10 @@ class servdb extends plugin var $goFonAreaCode= ""; var $goFonCountryCode= ""; var $ignore_account= TRUE; + var $goGlpiAdmin=""; + var $goGlpiDatabase = ""; + var $goGlpiPassword =""; + /* attribute list for save action */ var $attributes= array("goImapName", "goImapConnect", "goImapAdmin", "goImapPassword", @@ -128,6 +132,14 @@ class servdb extends plugin { $message= array(); + if(in_array("goGlpiServer",$this->objectclasses)){ + foreach(array("goGlpiAdmin","goGlpiDatabase") as $attr){ + if(empty($this->$attr)){ + $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), $attr); + } + } + } + /* All fields are marked as *must* */ if (in_array("goImapServer", $this->objectclasses)){ foreach (array("goImapAdmin", "goImapName") as $attr){ @@ -136,6 +148,7 @@ class servdb extends plugin } } + /* Check connect string */ if (!preg_match('/^\{[^:]+:[0-9]+.*\}$/', $this->goImapConnect)){ $message[]= sprintf(_("The imap connect string needs to be in the form '%s'."), -- 2.30.2