From: cajus Date: Thu, 9 Aug 2007 13:00:56 +0000 (+0000) Subject: Added more checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=14008fd143a48eb5cf8d26206aa79ab83b22548b;p=gosa.git Added more checks git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7033 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_dhcpPlugin.inc b/include/class_dhcpPlugin.inc index 0aeaa6226..b9d48b25f 100644 --- a/include/class_dhcpPlugin.inc +++ b/include/class_dhcpPlugin.inc @@ -123,7 +123,6 @@ class dhcpPlugin extends plugin function check($cache) { $message= array(); - return $message; } diff --git a/plugins/admin/systems/class_dhcpGroup.inc b/plugins/admin/systems/class_dhcpGroup.inc index 7e90215bf..47369286e 100644 --- a/plugins/admin/systems/class_dhcpGroup.inc +++ b/plugins/admin/systems/class_dhcpGroup.inc @@ -101,6 +101,10 @@ class dhcpGroup extends dhcpPlugin } } + /* Check external plugins */ + $net= $this->network->check(); + $adv= $this->advanced->check(); + $message= array_merge($message, $net, $adv); return $message; } diff --git a/plugins/admin/systems/class_dhcpHost.inc b/plugins/admin/systems/class_dhcpHost.inc index 5e9e00d22..77fdfdb6c 100644 --- a/plugins/admin/systems/class_dhcpHost.inc +++ b/plugins/admin/systems/class_dhcpHost.inc @@ -35,8 +35,6 @@ class dhcpHost extends dhcpPlugin $this->dhcpHWaddress= $attrs['dhcpHWAddress'][0]; } - print_a($this); - $this->advanced->setAutoOptions(array("host-name")); $this->advanced->setAutoStatements(array("fixed-address")); } diff --git a/plugins/admin/systems/class_dhcpPool.inc b/plugins/admin/systems/class_dhcpPool.inc index 5137dae9b..d001c0663 100644 --- a/plugins/admin/systems/class_dhcpPool.inc +++ b/plugins/admin/systems/class_dhcpPool.inc @@ -147,6 +147,12 @@ class dhcpPool extends dhcpPlugin } $dn= preg_replace('/^[^,]+,/', '', $dn); } + + /* Check external plugins */ + $net= $this->network->check(); + $adv= $this->advanced->check(); + $message= array_merge($message, $net, $adv); + return $message; } diff --git a/plugins/admin/systems/class_dhcpService.inc b/plugins/admin/systems/class_dhcpService.inc index 25c0b53cc..477accb7e 100644 --- a/plugins/admin/systems/class_dhcpService.inc +++ b/plugins/admin/systems/class_dhcpService.inc @@ -145,6 +145,11 @@ class dhcpService extends dhcpPlugin $message[]= _('Default lease time needs to smaller than the maximum lease time.'); } + /* Check external plugins */ + $net= $this->network->check(); + $adv= $this->advanced->check(); + $message= array_merge($message, $net, $adv); + return $message; } diff --git a/plugins/admin/systems/class_dhcpSharedNetwork.inc b/plugins/admin/systems/class_dhcpSharedNetwork.inc index 03154b340..1a3c61e1e 100644 --- a/plugins/admin/systems/class_dhcpSharedNetwork.inc +++ b/plugins/admin/systems/class_dhcpSharedNetwork.inc @@ -148,7 +148,7 @@ class dhcpSharedNetwork extends dhcpPlugin "min-lease-time" => _("Min. lease time")) as $key => $val){ if (isset($this->statements[$key]) && $this->statements[$key] != "" && !is_id($this->statements[$key])){ - $message[]= sprintf(_("The value specified as '%s' is no valid integer!"), $val); + $message[]= sprintf(_("The value specified as '%s' is not numeric!"), $val); } } @@ -163,6 +163,11 @@ class dhcpSharedNetwork extends dhcpPlugin } } + /* Check external plugins */ + $net= $this->network->check(); + $adv= $this->advanced->check(); + $message= array_merge($message, $net, $adv); + return $message; } diff --git a/plugins/admin/systems/class_dhcpSubnet.inc b/plugins/admin/systems/class_dhcpSubnet.inc index 0f3c712b0..d9751ee1d 100644 --- a/plugins/admin/systems/class_dhcpSubnet.inc +++ b/plugins/admin/systems/class_dhcpSubnet.inc @@ -155,16 +155,23 @@ class dhcpSubnet extends dhcpPlugin } /* Check ip range */ - if(!is_ip_range($this->range_start,$this->range_stop)){ + if ($this->use_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."); + /* 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."); + } } + /* Check external plugins */ + $net= $this->network->check(); + $adv= $this->advanced->check(); + $message= array_merge($message, $net, $adv); + return $message; } diff --git a/plugins/admin/systems/dhcp_network.tpl b/plugins/admin/systems/dhcp_network.tpl index 905fb4d6a..5645a63ac 100644 --- a/plugins/admin/systems/dhcp_network.tpl +++ b/plugins/admin/systems/dhcp_network.tpl @@ -58,7 +58,7 @@
- {t}Server{/t}
+ {t}DNS server{/t}