From 90582733903ff313b1ee0c78a7e6004d00ded679 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 10 Jun 2005 12:51:55 +0000 Subject: [PATCH] Added check for goImapName. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@671 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDB.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/admin/systems/class_servDB.inc b/plugins/admin/systems/class_servDB.inc index 12612a580..260097ab2 100644 --- a/plugins/admin/systems/class_servDB.inc +++ b/plugins/admin/systems/class_servDB.inc @@ -9,6 +9,7 @@ class servdb extends plugin /* Object information */ var $goImapName= ""; + var $goImapName_old= ""; var $goImapConnect= ""; var $goImapAdmin= ""; var $goImapPassword= ""; @@ -56,6 +57,9 @@ class servdb extends plugin } } + /* We need to save the historical state of goImapName for later checking */ + $this->goImapName_old= $this->goImapName; + /* Always is account... */ $this->is_account= TRUE; } @@ -161,6 +165,13 @@ class servdb extends plugin } } } + if (in_array("goImapServer", $this->objectclasses) && + $this->goImapName != $this->goImapName_old) { + // Attribute has changed + if(!preg_match("/^[a-z0-9\.]+$/", $this->goImapName)) { + $message[]= sprintf(_("The imap name string needs to be a hostname or an IP-address.")); + } + } return ($message); } -- 2.30.2