Code

Fixed order of hook calls
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Aug 2008 21:02:01 +0000 (21:02 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Aug 2008 21:02:01 +0000 (21:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12212 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc

index 0695d11292911715e4f32b23488364c773100c11..611e87264ce9408cb64526cd2b79c2748fbdfefa 100644 (file)
@@ -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()));
     }
index 11623ba1d4a8095c52d366ea724e215fea4eb243..5c8ea3b0d16c747d84f77309fa101b3df7bc69bf 100644 (file)
@@ -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