From 63af277b3f94138e457a3f69edcf54e43be85a8c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 9 Aug 2007 09:56:55 +0000 Subject: [PATCH] Updated dhcpSubnet::save_object. Only handle posts if template was posted git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7024 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_dhcpSubnet.inc | 34 ++++++++++++---------- plugins/admin/systems/dhcp_subnet.tpl | 2 +- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/plugins/admin/systems/class_dhcpSubnet.inc b/plugins/admin/systems/class_dhcpSubnet.inc index 0e55c8e6f..7f8855b9e 100644 --- a/plugins/admin/systems/class_dhcpSubnet.inc +++ b/plugins/admin/systems/class_dhcpSubnet.inc @@ -101,21 +101,25 @@ class dhcpSubnet extends dhcpPlugin /* Save data to object */ function save_object() { - if (isset($_POST['cn'])){ - $this->cn= validate($_POST['cn']); - } - if (isset($_POST['dhcp_netmask'])){ - $this->dhcpNetMask= validate($_POST['dhcp_netmask']); - } - if (isset($_POST['use_range'])){ - $this->use_range= TRUE; - $this->range_start= validate($_POST['range_start']); - $this->range_stop= validate($_POST['range_stop']); - } else { - $this->use_range= FALSE; - } + if(isset($_POST['dhcp_subnet_posted'])){ + if (isset($_POST['cn'])){ + $this->cn= validate($_POST['cn']); + } + if (isset($_POST['dhcp_netmask'])){ + $this->dhcpNetMask= validate($_POST['dhcp_netmask']); + } + if (isset($_POST['use_range'])){ + $this->use_range= TRUE; + $this->range_start= validate($_POST['range_start']); + $this->range_stop= validate($_POST['range_stop']); + } else { + $this->use_range= FALSE; + } - dhcpPlugin::save_object(); + /* Move range to internal variable */ + $this->dhcpRange= $this->range_start." ".$this->range_stop; + dhcpPlugin::save_object(); + } } @@ -176,5 +180,5 @@ class dhcpSubnet extends dhcpPlugin } } - +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/dhcp_subnet.tpl b/plugins/admin/systems/dhcp_subnet.tpl index 419cb5237..5b871fc2d 100644 --- a/plugins/admin/systems/dhcp_subnet.tpl +++ b/plugins/admin/systems/dhcp_subnet.tpl @@ -30,7 +30,7 @@ - +

-- 2.30.2