Code

goFonQueueStrategy will be saved in correct format now
[gosa.git] / plugins / admin / systems / class_servDB.inc
index dd7c1d291b916f0aea477901021a5a261cbb9b57..ad41a149fba046e79b2dd943fa4c53faa773871d 100644 (file)
@@ -9,6 +9,7 @@ class servdb extends plugin
 
   /* Object information */
   var $goImapName= "";
+  var $goImapName_old= "";
   var $goImapConnect= "";
   var $goImapAdmin= "";
   var $goImapPassword= "";
@@ -25,6 +26,7 @@ class servdb extends plugin
   var $goFonPassword= "";
   var $goFonAreaCode= "";
   var $goFonCountryCode= "";
+  var $ignore_account= TRUE;
 
   /* attribute list for save action */
   var $attributes= array("goImapName", "goImapConnect", "goImapAdmin", "goImapPassword",
@@ -55,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;
   }
@@ -70,6 +75,9 @@ class servdb extends plugin
       $smarty->assign("$attr"."ACL", chkacl($this->acl, $attr));
     }
 
+    /* Don't show Asterisk for non-required attribute ipHostNumber and macAddress */
+    $smarty->assign("staticAddress", "");
+
     /* Classes... */
     foreach ($this->additionaloc as $oc => $dummy){
       if (isset($this->objectclasses[$oc])){
@@ -157,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);
   }
@@ -201,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);