From: cajus Date: Thu, 9 Aug 2007 10:42:30 +0000 (+0000) Subject: Added range checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=063a8d479a70d2e9832f287bb58559c741894754;p=gosa.git Added range checks git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7026 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_dhcpPool.inc b/plugins/admin/systems/class_dhcpPool.inc index 5386057a8..d1c016d58 100644 --- a/plugins/admin/systems/class_dhcpPool.inc +++ b/plugins/admin/systems/class_dhcpPool.inc @@ -122,9 +122,17 @@ class dhcpPool extends dhcpPlugin $message[]= _("Field 'Range' contains invalid IP addresses."); } - if(!is_ip_range($this->range_start,$this->range_stop)){ - $message[] = _("Field 'Range' contains invalid IP range."); - } + if(!is_ip_range($this->range_start,$this->range_stop)){ + $message[] = _("Field 'Range' contains invalid IP range."); + } + + /* Check if range is in the network */ + #TODO: look for preceeding subnet entries in $cache and check if the + # range is valid. + #if (!is_in_network($this->cn, $this->dhcpNetMask, $this->range_start) || + # !is_in_network($this->cn, $this->dhcpNetMask, $this->range_stop)){ + # $message[] = _("'Range' is not inside the configured network."); + #} return $message; } diff --git a/plugins/admin/systems/class_dhcpSubnet.inc b/plugins/admin/systems/class_dhcpSubnet.inc index 7f8855b9e..2620a7be0 100644 --- a/plugins/admin/systems/class_dhcpSubnet.inc +++ b/plugins/admin/systems/class_dhcpSubnet.inc @@ -154,11 +154,17 @@ class dhcpSubnet extends dhcpPlugin } } - /* Check ip range */ + /* Check ip range */ if(!is_ip_range($this->range_start,$this->range_stop)){ $message[] = _("Field 'Range' contains invalid IP range."); } + /* Check if range is in the network */ + if (!is_in_network($this->cn, $this->dhcpNetMask, $this->range_start) || + !is_in_network($this->cn, $this->dhcpNetMask, $this->range_stop)){ + $message[] = _("'Range' is not inside the configured network."); + } + return $message; }