From f618483dcfca0a2bbddd3289e7b568b4fe1dcafe Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Sep 2007 13:02:25 +0000 Subject: [PATCH] Updated post handling for dns git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7214 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 28 ++++++++++++------- plugins/admin/systems/class_servDNS.inc | 4 +++ .../admin/systems/class_servDNSeditZone.inc | 1 + .../systems/class_servDNSeditZoneEntries.inc | 1 + 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 53c27b8ed..c4057ea67 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -586,6 +586,12 @@ class plugin } if ($command != ""){ + + /* Additional attributes */ + foreach ($add_attrs as $name => $value){ + $command= preg_replace("/%$name/", $value, $command); + } + /* Walk through attribute list */ foreach ($this->attributes as $attr){ if (!is_array($this->$attr)){ @@ -594,11 +600,6 @@ class plugin } $command= preg_replace("/%dn/", $this->dn, $command); - /* Additional attributes */ - foreach ($add_attrs as $name => $value){ - $command= preg_replace("/%$name/", $value, $command); - } - if (check_command($command)){ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute"); @@ -620,6 +621,12 @@ class plugin } if ($command != ""){ + + /* Additional attributes */ + foreach ($add_attrs as $name => $value){ + $command= preg_replace("/%$name/", $value, $command); + } + /* Walk through attribute list */ foreach ($this->attributes as $attr){ if (!is_array($this->$attr)){ @@ -628,11 +635,6 @@ class plugin } $command= preg_replace("/%dn/", $this->dn, $command); - /* Additional attributes */ - foreach ($add_attrs as $name => $value){ - $command= preg_replace("/%$name/", $value, $command); - } - if (check_command($command)){ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute"); @@ -654,6 +656,12 @@ class plugin } if ($command != ""){ + + /* Additional attributes */ + foreach ($add_attrs as $name => $value){ + $command= preg_replace("/%$name/", $value, $command); + } + /* Walk through attribute list */ foreach ($this->attributes as $attr){ if (!is_array($this->$attr)){ diff --git a/plugins/admin/systems/class_servDNS.inc b/plugins/admin/systems/class_servDNS.inc index 92d0b2a78..93343090c 100644 --- a/plugins/admin/systems/class_servDNS.inc +++ b/plugins/admin/systems/class_servDNS.inc @@ -330,6 +330,7 @@ class servdns extends goService foreach($tmp['zoneUpdates'] as $dn => $attrs){ $ldap->cd($dn); $ldap->modify($attrs); + $this->handle_post_events("modify",array("dn" => $dn)); new log("modfiy","unknown/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); show_ldap_error($ldap->get_error(), sprintf(_("Updating of system server/dns with dn '%s' failed."),$this->dn)); } @@ -340,6 +341,7 @@ class servdns extends goService foreach($tmp['del'] as $dn => $del){ $ldap->cd($dn); $ldap->rmdir_recursive($dn); + $this->handle_post_events("remove",array("dn" => $dn)); new log("remove","unknown/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); show_ldap_error($ldap->get_error(), sprintf(_("Removing of system server/dns with dn '%s' failed."),$this->dn)); } @@ -358,10 +360,12 @@ class servdns extends goService if($ldap->fetch()){ $ldap->cd($dn); $ldap->modify ($attrs); + $this->handle_post_events("modify",array("dn" => $dn)); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/dns with dn '%s' failed."),$this->dn)); }else{ $ldap->cd($dn); $ldap->add($attrs); + $this->handle_post_events("create",array("dn" => $dn)); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/dns with dn '%s' failed."),$this->dn)); } } diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc index 1605df4b3..c71fdf67b 100644 --- a/plugins/admin/systems/class_servDNSeditZone.inc +++ b/plugins/admin/systems/class_servDNSeditZone.inc @@ -217,6 +217,7 @@ class servdnseditZone extends plugin $smarty->assign("AllowZoneEdit" , true); if(isset($_POST['EditZoneEntries'])){ $this->dialog= new servDNSeditZoneEntries($this->config,$this->dn,$this->ZoneObject); + $this->dialog->parent = $this; } } diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc index a485f8b11..7eace297a 100644 --- a/plugins/admin/systems/class_servDNSeditZoneEntries.inc +++ b/plugins/admin/systems/class_servDNSeditZoneEntries.inc @@ -299,6 +299,7 @@ class servDNSeditZoneEntries extends plugin $todo = array(); + /* Create todolist */ foreach($this->Devices as $name => $dev){ -- 2.30.2