Code

unused fields won't be checked anymore,
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Jun 2005 12:48:30 +0000 (12:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Jun 2005 12:48:30 +0000 (12:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@722 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_phoneGeneric.inc

index 8e67b5af174563a89c1b9568de7ae5f8dbf9c4ac..14a467dec0c2541260003561f2af9bd439193fae 100644 (file)
@@ -168,13 +168,18 @@ class phoneGeneric extends plugin
 
     /* To check for valid ip*/
     $num="(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
-    if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->goFonDefaultIP)){
+
+    if(in_array("goFonDefaultIP",$this->usedattrs[$this->selected_categorie])){
+      if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->goFonDefaultIP)){
        $message[]= _("Wrong IP format in field goFonDefaultIP.");
+      }
     }
     
     /* Check for valid number */
-    if((strlen($this->goFonQualify))!=(strlen((int)($this->goFonQualify)))){
-      $message[]= _("The given value for goFonQualify is not a valid number.");
+    if(in_array("goFonDefaultIP",$this->usedattrs[$this->selected_categorie])){
+      if((strlen($this->goFonQualify))!=(strlen((int)($this->goFonQualify)))){
+        $message[]= _("The given value for goFonQualify is not a valid number.");
+      } 
     }
 
     /* must: cn, macAddress, ipHostNumber */