X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_servDB.inc;h=ad41a149fba046e79b2dd943fa4c53faa773871d;hb=0eeb438528e816232aac90579be963b2218087c7;hp=12612a580b17d6b71fdf25c6c0382a520db21e7b;hpb=c02a9629a834fa473d9fb709e9ca3d531c936c5e;p=gosa.git diff --git a/plugins/admin/systems/class_servDB.inc b/plugins/admin/systems/class_servDB.inc index 12612a580..ad41a149f 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); } @@ -205,8 +216,6 @@ class servdb extends plugin } $this->attrs = array_reverse($this->attrs); - - /* Write to LDAP */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn);