Code

some checks addded to phone setup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Jun 2005 11:01:10 +0000 (11:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Jun 2005 11:01:10 +0000 (11:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@706 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_phoneGeneric.inc

index ddaeb30bfb4f321cde709cf8ee4d8817e4997abe..5a7b9b14b0e4b4857b499e564f3dffc2880ba95c 100644 (file)
@@ -165,6 +165,16 @@ class phoneGeneric extends plugin
     $message= array();
     $this->dn= "cn=".$this->cn.",ou=phones,ou=systems,".$this->base;
 
+    /* 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)){
+       $message[]= _("Wrong IP format in field goFonDefaultIP\\n");
+    }
+    
+    if((strlen($this->goFonQualify))!=(strlen((int)($this->goFonQualify)))){
+      $message[]= _("The given value for goFonQualify is not a valid number.");
+    }
+
     /* must: cn, macAddress, ipHostNumber */
     if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){
       $message[]= _("The required field 'Phone name' is not set.");