Code

Updated dhcp classes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 Jul 2008 13:16:41 +0000 (13:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 Jul 2008 13:16:41 +0000 (13:16 +0000)
-The have now a parent class which represents the currently edited object.

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

gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc

index 08d728efb7e4bd9fd694e0fe0b859357b63c5c29..10978700ba232070f4cc577423660bea46006bc1 100644 (file)
@@ -54,10 +54,13 @@ class dhcpGroup extends dhcpPlugin
       $this->network->$type= $this->advanced->$type;
     }
 
-    /* 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>";
-
+       /* Add footer */
+       $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>";
 
     return ($display);
   }
index 89b0c1d806e8cb5ba96fef558020e161a7e4e7b4..26fabb20f8aed28dfe9b025f7729531622587d44 100644 (file)
@@ -27,9 +27,9 @@ class dhcpHost extends dhcpPlugin
   /* attribute list for save action */
   var $objectclasses= array("top", "dhcpHost");
 
-  function dhcpHost($attrs,$host_exists_in_gosa = FALSE)
+  function dhcpHost($parent,$attrs,$host_exists_in_gosa = FALSE)
   {
-    dhcpPlugin::dhcpPlugin($attrs);
+    dhcpPlugin::dhcpPlugin($parent,$attrs);
 
     /* Load attributes */
     if (!$this->new){
@@ -82,9 +82,12 @@ class dhcpHost 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>";
 
     return ($display);
   }
index e2cff119b502d6e043c2ce3af8234ac843597215..63c039b145366f5561b98def466cee255084ca97 100644 (file)
@@ -70,8 +70,12 @@ class dhcpPool 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>";
 
     return ($display);
   }
index 59c56588406aff5e7e34b3558deaec7a2153586e..fd42f20060f10d2ee5d68d0cd8fea27bfe3a9339 100644 (file)
@@ -94,9 +94,12 @@ class dhcpService 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>";
 
     return ($display);
 
index e512cb663a9369ed23959f7fa098dbb25923f3c6..93b0330d174e33c850b0648a51bef7b4f8e660b6 100644 (file)
@@ -23,9 +23,9 @@ class dhcpSharedNetwork extends dhcpPlugin
   /* attribute list for save action */
   var $objectclasses= array('top', 'dhcpSharedNetwork');
 
-  function dhcpSharedNetwork($attrs)
+  function dhcpSharedNetwork($parent,$attrs)
   {
-    dhcpPlugin::dhcpPlugin($attrs);
+    dhcpPlugin::dhcpPlugin($parent,$attrs);
 
     $this->advanced->setAutoStatements(array("server-identifier", "default-lease-time",
           "max-lease-time", "min-lease-time", "authoritative", "deny-unknown-clients",
@@ -88,9 +88,12 @@ class dhcpSharedNetwork 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>";
 
     return ($display);
   }
index fe10195ccba46fc2a5b57135d2ac70d1bc2ebf3c..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 */
@@ -89,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;