Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_servDNS.inc
index 89d2f3f367ea5d8eee7d4e883ce540ff13a763bf..fed9c92f71120d54fd01530aac9e7d3fe50f5c8c 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-require_once("class_goService.inc");
-
 class servdns extends goService
 {
   /* CLI vars */
@@ -16,7 +14,6 @@ class servdns extends goService
 
   var $RecordTypes      = array();
   var $Zones            = array();
-  var $dialog           = NULL;
 
   var $orig_dn          = "";
 
@@ -32,7 +29,7 @@ class servdns extends goService
   var $take_over_id       = -1;
 
 
-  function servdns ($config, $dn= NULL, $parent= NULL)
+  function servdns (&$config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);
 
@@ -199,14 +196,14 @@ class servdns extends goService
           unset($this->Zones[$this->dialog->OldZoneName]);
         }
         $this->Zones[$ret['zoneName']] = $ret;
-        $this->dialog = NULL;
+        $this->dialog = FALSE;
       }
     }
 
     /* Cancel zone edit / new 
      */
     if(isset($_POST['CancelZoneChanges'])){
-      $this->dialog = NULL;
+      $this->dialog = FALSE;
     }
 
     /* Add empty new zone 
@@ -259,7 +256,7 @@ class servdns extends goService
 
     /* Show dialog 
      */
-    if($this->dialog!= NULL){
+    if(is_object($this->dialog)){
       $this->dialog->save_object();
       $this->dialog->parent = $this;
       return($this->dialog->execute());
@@ -420,6 +417,13 @@ class servdns extends goService
       return;
     }
 
+    /* Save zone editor changes now */
+    foreach($this->Zones as $name => $zone){
+      if(isset($zone['zoneEditor'] ) && $zone['zoneEditor'] != NULL && is_object($zone['zoneEditor'])){
+        $zone['zoneEditor']->save();
+        unset($this->Zones[$name]['zoneEditor']);;
+      }
+    }
 
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);  
@@ -470,8 +474,8 @@ class servdns extends goService
 
       /* Handle Post events */
       if(preg_match("/^zoneName=/",$dn)){
-        $this->handle_post_events("remove",array("dn" => $dn,"zoneName" => $for));
-        $this->handle_post_events("remove",array("dn" => $dn,"zoneName" => $rev));
+#        $this->handle_post_events("remove",array("dn" => $dn,"zoneName" => $for));
+#        $this->handle_post_events("remove",array("dn" => $dn,"zoneName" => $rev));
       }
     }
 
@@ -493,7 +497,7 @@ class servdns extends goService
 
         /* Handle Post events */
         if(preg_match("/^zoneName=/",$dn)){
-          $this->handle_post_events("modify",array("dn" => $dn,"zoneName" => $attrs['zoneName']));
+#          $this->handle_post_events("modify",array("dn" => $dn,"zoneName" => $attrs['zoneName']));
         }
       }else{
         $ldap->cd($dn);
@@ -502,10 +506,11 @@ class servdns extends goService
 
         /* Handle Post events */
         if(preg_match("/^zoneName=/",$dn)){
-          $this->handle_post_events("add",array("dn" => $dn,"zoneName" => $attrs['zoneName']));
+#          $this->handle_post_events("add",array("dn" => $dn,"zoneName" => $attrs['zoneName']));
         }
       }
     }
+    $this->handle_post_events("modify");
   }