Code

Save dns zone setting when server object is saved.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Oct 2007 08:57:14 +0000 (08:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Oct 2007 08:57:14 +0000 (08:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7682 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDNS.inc
plugins/admin/systems/class_servDNSeditZone.inc
plugins/admin/systems/class_servDNSeditZoneEntries.inc
plugins/admin/systems/servDNSeditZoneEntries.tpl
setup/class_setupStep_Config3.inc

index 2bc0352779ec0967934863d134a94d544431af68..fed9c92f71120d54fd01530aac9e7d3fe50f5c8c 100644 (file)
@@ -417,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']);  
index 8ea3bcc392c5dd56a2cea4d70f082d03966d4c85..d5df0871d9bbbb912ec1699716255342ccb2b451 100644 (file)
@@ -39,6 +39,8 @@ class servdnseditZone extends plugin
 
   var $dialog                   = false;
 
+  var $zoneEditor               = NULL;
+
   var $isNew                    = true;
 
   var $ZoneObject               = array();
@@ -61,7 +63,9 @@ class servdnseditZone extends plugin
     }else{
       $this->ZoneObject         = $attrs;
 
-
+      if(isset($attrs['zoneEditor'])){
+        $this->zoneEditor         = $attrs['zoneEditor'];
+      }
       $this->OldZoneName        = $attrs['zoneName'];
       $this->OldReverseZone     = $attrs['ReverseZone'];
 
@@ -216,8 +220,11 @@ class servdnseditZone extends plugin
     }else{
       $smarty->assign("AllowZoneEdit" , true);
       if(isset($_POST['EditZoneEntries'])){
-        $this->dialog= new servDNSeditZoneEntries($this->config,$this->dn,$this->ZoneObject);
-        $this->dialog->parent = $this;
+        if($this->zoneEditor == NULL){
+          $this->zoneEditor= new servDNSeditZoneEntries($this->config,$this->dn,$this->ZoneObject);
+          $this->zoneEditor->parent = $this;
+        }
+        $this->dialog = $this->zoneEditor;
       }
     }
 
@@ -231,13 +238,14 @@ class servdnseditZone extends plugin
           print_red($msg);
         }
       }else{
-        $this->dialog->save();
-        $rev = FlipIp(getNameFromMix($this->InitialReverseZone)).".in-addr.arpa";
-        $for = getNameFromMix($this->InitialzoneName);
-       
-        $this->parent->handle_post_events("modify",array("dn" => $this->dn,"zoneName" => $rev));
-        $this->parent->handle_post_events("modify",array("dn" => $this->dn,"zoneName" => $for));
-        $this->dialog = false;
+        $this->zoneEditor = clone $this->dialog;
+        $this->dialog = FALSE;
+#       $rev = FlipIp(getNameFromMix($this->InitialReverseZone)).".in-addr.arpa";
+#       $for = getNameFromMix($this->InitialzoneName);
+#      
+#       $this->parent->handle_post_events("modify",array("dn" => $this->dn,"zoneName" => $rev));
+#       $this->parent->handle_post_events("modify",array("dn" => $this->dn,"zoneName" => $for));
+#       $this->dialog = false;
       }
     }
 
@@ -529,6 +537,8 @@ class servdnseditZone extends plugin
     }
 
     $ret['RECORDS'][] = array("type" => "nSRecord","value" => $ret['sOAprimary']) ;
+
+    $ret['zoneEditor'] = $this->zoneEditor;
     return($ret);
   }
 
index 5f32b5cb71bf355fb8240ea7d808533e98da6907..8453ae794e3322bd5fd1e648f050131246d5f74c 100644 (file)
@@ -296,7 +296,7 @@ class servDNSeditZoneEntries extends plugin
           if(!isset($tmp[$Rec['type']])){
             $tmp[$Rec['type']] = "";
           }else{
-            $message[] = sprintf(_("The record type '%s' is a unique type and can't be defined twice."),$type);
+            $message[] = sprintf(_("The record type '%s' is a unique type and can't be defined twice."),$Rec['type']);
           }
         }
 
index 0396575621171ae6869ac771ab7587e0e822e92c..9c0428c29d58795aa28029bf97225bd7f7ad7290 100644 (file)
@@ -1,7 +1,4 @@
 <h2>{t}This dialog allows you to configure all components of this DNS zone on a single list.{/t}</h2>
-{t}Be careful editing record types with this dialog. All changes will be saved immediately when using the save button.{/t}
-<br>
-<br>
 <p class="seperator">&nbsp;</p>
 {if $disableDialog}
        <br><b>
index 3ad9a4d46745e405d8e9fce33c7632efb998a17b..8033768c1cb4e4de96649da7c80b0400eee1187a 100644 (file)
@@ -99,7 +99,7 @@ class Step_Config3 extends setup_step
         }
       }
       
-      foreach(array("list_summary","strict_units","noprimarygroup","forceglobals","forcessl","ldapstats","user_filter_cookie","warnssl","compile","debuglevel","session_lifetime") as $name){
+      foreach(array("list_summary","strict_units","snmpcommunity","noprimarygroup","forceglobals","forcessl","ldapstats","user_filter_cookie","warnssl","compile","debuglevel","session_lifetime") as $name){
         if(isset($_POST[$name])){
           $this->optional[$name] = get_post($name);
         }