From 3fc82f29c0266e92b3cd30a7dae5cd5ab409e86d Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 13 Aug 2008 21:02:01 +0000 Subject: [PATCH] Fixed order of hook calls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12212 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_terminalGeneric.inc | 20 ++++++++++++------- .../systems/goto/class_workstationGeneric.inc | 10 +++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index 0695d1129..611e87264 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -525,6 +525,11 @@ class termgeneric extends plugin } } + /* cn=default and macAddress=- indicates that this is a template */ + if($this->cn == "default"){ + $this->netConfigDNS->macAddress = "-"; + } + /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); if ($this->orig_dn == 'new'){ @@ -536,12 +541,20 @@ class termgeneric extends plugin } $ldap->add($this->attrs); new log("create","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); + + $this->netConfigDNS->cn = $this->cn; + $this->netConfigDNS->save(); + $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } else { $ldap->cd($this->dn); $this->cleanup(); $ldap->modify ($this->attrs); new log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); + + $this->netConfigDNS->cn = $this->cn; + $this->netConfigDNS->save(); + $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Update all accessTo/trust dependencies */ @@ -550,13 +563,6 @@ class termgeneric extends plugin } } - /* cn=default and macAddress=- indicates that this is a template */ - if($this->cn == "default"){ - $this->netConfigDNS->macAddress = "-"; - } - - $this->netConfigDNS->cn = $this->cn; - $this->netConfigDNS->save(); if (!$ldap->success()){ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); } diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index 11623ba1d..5c8ea3b0d 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -579,6 +579,11 @@ class workgeneric extends plugin } } + /* cn=default and macAddress=- indicates that this is a template */ + if($this->cn == "wdefault"){ + $this->netConfigDNS->macAddress = "-"; + } + /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); if ($this->orig_dn == 'new'){ @@ -615,11 +620,6 @@ class workgeneric extends plugin $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } - /* cn=default and macAddress=- indicates that this is a template */ - if($this->cn == "wdefault"){ - $this->netConfigDNS->macAddress = "-"; - } - if ($activate && class_available("DaemonEvent")){ /* Send installation activation -- 2.30.2