Code

Updated dhcp classes
[gosa.git] / gosa-plugins / dhcp / admin / systems / services / dhcp / class_dhcpSubnet.inc
index 04b9ceb8035af21bc79d3d41ac956dc1972cef9a..c0bf218d1e8fd11f1dc219baaf9e1dc37de1a44f 100644 (file)
@@ -30,9 +30,9 @@ class dhcpSubnet extends dhcpPlugin
   /* attribute list for save action */
   var $objectclasses= array('top', 'dhcpSubnet', 'dhcpOptions');
 
-  function dhcpSubnet($attrs)
+  function dhcpSubnet($parent,$attrs)
   {
-    dhcpPlugin::dhcpPlugin($attrs);
+    dhcpPlugin::dhcpPlugin($parent,$attrs);
 
     if (!$this->new){
       /* Load attributes */
@@ -57,6 +57,9 @@ class dhcpSubnet extends dhcpPlugin
     $smarty->assign("cn", $this->cn);
     $smarty->assign("dhcp_netmask", $this->dhcpNetMask);
 
+    /* Assign ACLs */
+    $smarty->assign("acl",$this->parent->getacl(""));
+
     /* Prepare range */
     if ($this->use_range){
       $smarty->assign("use_range", "checked");
@@ -69,7 +72,7 @@ class dhcpSubnet extends dhcpPlugin
     $smarty->assign("range_stop", $this->range_stop);
 
     /* Show main page */
-    $display= $smarty->fetch(get_template_path('dhcp_subnet.tpl', TRUE)).$this->network->execute();
+    $display= $smarty->fetch(get_template_path('dhcp_subnet.tpl', TRUE, dirname(__FILE__))).$this->network->execute();
 
     /* Merge arrays for advanced view */
     $this->fix_options();
@@ -86,8 +89,13 @@ class dhcpSubnet extends dhcpPlugin
     }
 
     /* Add footer */
-    $display.= "<div style='width:100%;text-align:right;margin-top:5px;'><input type=submit name='save_dhcp' value='".msgPool::saveButton()."'>".
-               "&nbsp;<input type=submit name='cancel_dhcp' value='".msgPool::cancelButton()."'></div>";
+    $display.= "<div style='width:100%;text-align:right;margin-top:5px;'>";
+    if(preg_match("/w/",$this->parent->getacl(""))){
+        $display.=   "<input type=submit name='save_dhcp' value='".msgPool::saveButton()."'>&nbsp;";
+    }
+    $display.=   "<input type=submit name='cancel_dhcp' value='".msgPool::cancelButton()."'>";
+    $display.= "</div>";
+
 
     /* Show main page */
     return $display;