Code

Updated dhcpSubnet::save_object.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Aug 2007 09:56:55 +0000 (09:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Aug 2007 09:56:55 +0000 (09:56 +0000)
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
plugins/admin/systems/dhcp_subnet.tpl

index 0e55c8e6f79bf9566727349eaf02d4c47fe8bb1e..7f8855b9eb80a7862f93067261f8391e31bb38fd 100644 (file)
@@ -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:
 ?>
index 419cb52376e591c1b3ce2b2bca03f799e218b07f..5b871fc2de9725da05af6e8a9dac422efbf1b215 100644 (file)
@@ -30,7 +30,7 @@
   </td>
   </tr>
 </table>
-
+<input type='hidden' name='dhcp_subnet_posted' value='1'>
 <p class="seperator"></p>
 
 <!-- Place cursor in correct field -->