From 2c880b99df81a380323f5dbcd78df50a4172b511 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 Jul 2008 06:35:09 +0000 Subject: [PATCH] Updated DHCP servive -Fixed Problem with checkboxes for Shared Networks. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11754 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/services/dhcp/class_dhcpPlugin.inc | 9 +++++++-- .../services/dhcp/class_dhcpSharedNetwork.inc | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc index ac8d0f86a..f6b9f39b3 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc @@ -66,10 +66,14 @@ class dhcpPlugin extends plugin } else { $value= preg_replace('/^[^\s]+\s/', '', $opt); } - $this->statements[$idx]= $value; + + if(preg_match("/^allow\s/",$opt) || preg_match("/^deny\s/",$opt)){ + $this->statements[$opt]= ""; + }else{ + $this->statements[$idx]= $value; + } } } - } else { /* We keep the parent dn here if it's new */ $this->dn= $attrs; @@ -210,4 +214,5 @@ class dhcpPlugin extends plugin } +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc index 15ead8eeb..a2b4d69f9 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc @@ -28,8 +28,9 @@ class dhcpSharedNetwork extends dhcpPlugin dhcpPlugin::dhcpPlugin($parent,$attrs); $this->advanced->setAutoStatements(array("server-identifier", "default-lease-time", - "max-lease-time", "min-lease-time", "authoritative", "deny-unknown-clients", - "deny-bootp", "deny-booting")); + "max-lease-time", "min-lease-time", "authoritative", "deny unknown-clients", + "deny bootp", "deny booting", "allow unknown-clients", + "allow bootp", "allow booting")); } @@ -75,6 +76,18 @@ class dhcpSharedNetwork extends dhcpPlugin /* Merge arrays for advanced view */ $this->fix_options(); + + /* Remove states configured by checkboxes. + */ + foreach(array("deny unknown-clients", + "deny bootp", "deny booting", "allow unknown-clients", + "allow bootp", "allow booting") as $name){ + if(isset($this->advanced->statements[$name])){ + unset($this->advanced->statements[$name]); + unset($this->network->statements[$name]); + } + } + foreach (array("options", "statements") as $type){ $this->advanced->$type= $this->$type + $this->network->$type; } @@ -196,4 +209,5 @@ class dhcpSharedNetwork extends dhcpPlugin } +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> -- 2.30.2