Code

Updated DHCP servive
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Jul 2008 06:35:09 +0000 (06:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Jul 2008 06:35:09 +0000 (06:35 +0000)
-Fixed Problem with checkboxes for Shared Networks.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11754 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc

index ac8d0f86a81496ff030cc1191ce32d5ccc8ca6dd..f6b9f39b3c5d0e819e37e97b388cce5d35ae349e 100644 (file)
@@ -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:
 ?>
index 15ead8eeb2d6196a84f9463c44509522dcd395db..a2b4d69f98aa5950f0a31a9d6b28d8e3a8ff06cd 100644 (file)
@@ -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:
 ?>