From 2d71bd7c31d9b0c6a5122f169418ce5e65d467bc Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 29 Oct 2007 08:57:14 +0000 Subject: [PATCH] Save dns zone setting when server object is saved. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7682 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDNS.inc | 7 +++++ .../admin/systems/class_servDNSeditZone.inc | 30 ++++++++++++------- .../systems/class_servDNSeditZoneEntries.inc | 2 +- .../admin/systems/servDNSeditZoneEntries.tpl | 3 -- setup/class_setupStep_Config3.inc | 2 +- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/plugins/admin/systems/class_servDNS.inc b/plugins/admin/systems/class_servDNS.inc index 2bc035277..fed9c92f7 100644 --- a/plugins/admin/systems/class_servDNS.inc +++ b/plugins/admin/systems/class_servDNS.inc @@ -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']); diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc index 8ea3bcc39..d5df0871d 100644 --- a/plugins/admin/systems/class_servDNSeditZone.inc +++ b/plugins/admin/systems/class_servDNSeditZone.inc @@ -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); } diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc index 5f32b5cb7..8453ae794 100644 --- a/plugins/admin/systems/class_servDNSeditZoneEntries.inc +++ b/plugins/admin/systems/class_servDNSeditZoneEntries.inc @@ -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']); } } diff --git a/plugins/admin/systems/servDNSeditZoneEntries.tpl b/plugins/admin/systems/servDNSeditZoneEntries.tpl index 039657562..9c0428c29 100644 --- a/plugins/admin/systems/servDNSeditZoneEntries.tpl +++ b/plugins/admin/systems/servDNSeditZoneEntries.tpl @@ -1,7 +1,4 @@

{t}This dialog allows you to configure all components of this DNS zone on a single list.{/t}

-{t}Be careful editing record types with this dialog. All changes will be saved immediately when using the save button.{/t} -
-

 

{if $disableDialog}
diff --git a/setup/class_setupStep_Config3.inc b/setup/class_setupStep_Config3.inc index 3ad9a4d46..8033768c1 100644 --- a/setup/class_setupStep_Config3.inc +++ b/setup/class_setupStep_Config3.inc @@ -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); } -- 2.30.2