Code

Updated dhcp service for trunk, not complete at all
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Aug 2007 09:35:16 +0000 (09:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Aug 2007 09:35:16 +0000 (09:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7163 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDHCP.inc
plugins/admin/systems/servdhcp.tpl

index 168d7a8e85d03bafa5b7c84029cf9166f8bfa60c..fbb7b727e6007f350e053d25a84262f0c7069d21 100644 (file)
@@ -48,7 +48,6 @@ class servdhcp extends plugin
     if (!count($this->dhcpSections)){
       $this->is_account= FALSE;
     }
-               
   }
 
 
@@ -57,6 +56,8 @@ class servdhcp extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    $this->reload();
+
     /* Fill templating stuff */
     $smarty= get_smarty();
     $display= "";
@@ -151,7 +152,7 @@ class servdhcp extends plugin
 
     /* Remove section? */
     if (isset($_POST['delete_dhcp_confirm'])){
-      if (chkacl($this->acl, "delete") == ""){
+      if ($this->acl_is_removeable()){
         unset($this->dhcpSections[$this->current_object]);
         unset($this->dhcpObjectCache[$this->current_object]);
         $this->dhcpObjectCache[$this->current_object]= array();
@@ -211,8 +212,8 @@ class servdhcp extends plugin
 
     /* Show tab dialog headers */
     if ($this->is_account){
-      $display= $this->show_header(_("Remove DHCP service"),
-          _("This server has DHCP features enabled. You can disable them by clicking below."));
+#      $display= $this->show_header(_("Remove DHCP service"),
+#          _("This server has DHCP features enabled. You can disable them by clicking below."));
 
       if (!count($this->dhcpObjectCache)){
         $attrs= array();
@@ -230,8 +231,9 @@ class servdhcp extends plugin
       }
 
     } else {
-      $display= $this->show_header(_("Add DHCP service"),
-          _("This server has DHCP features disabled. You can enable them by clicking below."));
+#      $display= $this->show_header(_("Add DHCP service"),
+
+#          _("This server has DHCP features disabled. You can enable them by clicking below."));
       return ($display);
     }
 
@@ -282,8 +284,6 @@ class servdhcp extends plugin
       }
     }
 
-    $smarty->assign("dhcpACL",chkacl($this->acl,"servdhcp"));
-
     /* Display tempalte */
     $smarty->assign("DhcpList",$DhcpList->DrawList());
     $display.= $smarty->fetch(get_template_path('servdhcp.tpl', TRUE));
@@ -452,8 +452,11 @@ class servdhcp extends plugin
     $ui= get_userinfo();
     $me= $this->dn;
 
-    $list= get_list("(&(objectClass=dhcpService)(|(dhcpPrimaryDN=$me)(dhcpSecondaryDN=$me)(dhcpServerDN=$me)(dhcpFailOverPeerDN=$me)))", $ui->subtreeACL, $this->config->current['BASE'], array("cn"));
+    $filter = "(&(objectClass=dhcpService)(|(dhcpPrimaryDN=$me)(dhcpSecondaryDN=$me)(dhcpServerDN=$me)(dhcpFailOverPeerDN=$me)))";
+
+    $list= get_list($filter, array("server"), $this->config->current['BASE'], array("cn"),GL_SIZELIMIT | GL_SUBSEARCH);
     $final= array();
+
     foreach ($list as $value){
 
       /* Set header */
@@ -544,6 +547,29 @@ class servdhcp extends plugin
     return ($type);
   }
 
+
+  /* Return plugin informations for acl handling */
+  function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("DHCP service"),
+          "plDescription" => _("DHCP service")." ("._("Services").")",
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 84,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("server"),
+
+          "plProvidedAcls"=> array(
+            "cn"                => _("Blalalasasd"),
+            "dhcpPrimaryDN"     => _("KEkse"),
+            "dhcpSecondaryDN"   => _("KEkse2"),
+            "dhcpServerDN"      => _("KEkse3"),
+            "dhcpFailOverPeerDN"=> _("KEkse4"),
+            "dhcpOptions"       => _("blabla"))
+    ));
+  }
+
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 76739f150700d4718b8d26640c964f873bfcdadb..4961b501714a000d4268f03943a5e2e8172b929b 100644 (file)
@@ -3,7 +3,7 @@
 <tr>
        <td style="width:100%;vertical-align:top;">
                {$DhcpList}
-<!--           <input type="submit" name="takeOver" value="{t}Take over{/t}" {$dhcpACL}>-->
+<!--           <input type="submit" name="takeOver" value="{t}Take over{/t}" >-->
        </td>
 </tr>
 </table>