Code

ACL: Skip listing system snapshot that we are not able to restore.
[gosa.git] / plugins / admin / systems / class_servDNS.inc
index fbd9c812c0a74fcfdc9db2cf4e76ab50298a3310..c74c27fd379fdbbfb0ba2364b557c533b4e46d9f 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
-class servdns extends plugin
+require_once("class_goService.inc");
+
+class servdns extends goService
 {
   /* CLI vars */
   var $cli_summary= "Manage server basic objects";
@@ -25,11 +27,11 @@ class servdns extends plugin
   var $DisplayName      = "";
   var $StatusFlag       = "";
 
-  function servdns ($config, $dn= NULL)
+  function servdns ($config, $dn= NULL, $parent= NULL)
   {
-    plugin::plugin ($config, $dn);
+    plugin::plugin ($config, $dn, $parent);
 
-    $this->DisplayName = _("Domain name system service");
+    $this->DisplayName = _("DNS service");
 
     $this->orig_dn = $dn;
 
@@ -70,10 +72,10 @@ class servdns extends plugin
     }
 
     if ($this->is_account){
-      $display= $this->show_header(_("Remove DNS service"),
+      $display= $this->show_disable_header(_("Remove DNS service"),
           _("This server has DNS features enabled. You can disable them by clicking below."));
     } else {
-      $display= $this->show_header(_("Add DNS service"),
+      $display= $this->show_enable_header(_("Add DNS service"),
           _("This server has DNS features disabled. You can enable them by clicking below."));
       return ($display);
     }
@@ -210,14 +212,16 @@ class servdns extends plugin
 
     /* There are still entries using this configuration
      *  Abort deletion
-     */ 
+     */
     if(count($used)){
       $i = 2;
       $str ="";
       foreach($used as $dn){
-        if($i > 0 ){
+        if($i > 0 && !preg_match("/,relativeDomainName=/",$dn)){
           $i --;
-          $str.=$dn." ";
+          $name = preg_replace("/^[^=]+=([^,]*),.*$/","\\1",$dn);
+          $zone = preg_replace("/^.*zoneName=([^,]*),.*$/","\\1",$dn);
+          $str.= $name.".".$zone." ";
         }
       }
 
@@ -347,18 +351,8 @@ class servdns extends plugin
 
   function getListEntry()
   {
-    $this->updateStatusState();
-    $flag = $this->StatusFlag;
-    if(empty($flag)){
-      $fields['Status']      = "";
-    }else{
-      $fields['Status']      = $this->$flag;
-    }
+    $fields               = goService::getListEntry(); 
     $fields['Message']    = _("DNS service");
-    $fields['AllowStart'] = true;
-    $fields['AllowStop']  = true;
-    $fields['AllowRestart'] = true;
-    $fields['AllowRemove']= true;
     $fields['AllowEdit']  = true;
     return($fields);
   }
@@ -381,6 +375,34 @@ class servdns extends plugin
       $this->$flag = $attrs[$flag][0];
     }
   }
+
+
+  /* Return plugin informations for acl handling */
+  function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("DNS service"),
+          "plDescription" => _("DNS service")." ("._("Services").")",
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 83,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("server"),
+
+          "plProvidedAcls"=> array(
+            "zoneName"      =>_("Zone name"),
+            "ReverseZone"   =>_("Reverse zone"),
+            "sOAprimary"    =>_("Primary dns server"),
+            "sOAmail"       =>_("Mail address"),
+            "sOAserial"     =>_("Serial"),
+            "sOArefresh"    =>_("Refresh"),
+            "sOAretry"      =>_("Retry"),
+            "sOAexpire"     =>_("Expire"),
+            "sOAttl"        =>_("TTL"),
+            "zoneRecords"   =>_("Zone records"))
+    ));
+  }
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>