From ab7c873500a3f996bc88871c5694b96f6742c3f8 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 14 Jun 2005 11:01:10 +0000 Subject: [PATCH] some checks addded to phone setup git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@706 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_phoneGeneric.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index ddaeb30bf..5a7b9b14b 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -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."); -- 2.30.2