From 72fbd4f8163b7cc395e5215c3b807a105333df15 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 21 May 2007 07:28:50 +0000 Subject: [PATCH] Fixed post events for systems git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6408 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_componentGeneric.inc | 10 +++------- plugins/admin/systems/class_phoneGeneric.inc | 9 +++------ plugins/admin/systems/class_printGeneric.inc | 9 +++------ plugins/admin/systems/class_servGeneric.inc | 4 ++-- plugins/admin/systems/class_terminalGeneric.inc | 9 +++------ plugins/admin/systems/class_workstationGeneric.inc | 6 +++--- 6 files changed, 17 insertions(+), 30 deletions(-) diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 3c318ad5e..2463ca117 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -100,7 +100,7 @@ class componentGeneric extends plugin $this->netConfigDNS->remove_from_parent(); $ldap->rmdir($this->dn); show_ldap_error($ldap->get_error(), _("Removing generic component failed")); - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); @@ -206,7 +206,7 @@ class componentGeneric extends plugin $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); $ldap->cd($this->dn); $ldap->add($this->attrs); - $this->handle_post_events("add"); + $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } else { if ($this->orig_dn != $this->dn){ $this->move($this->orig_dn, $this->dn); @@ -216,18 +216,14 @@ class componentGeneric extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - $this->handle_post_events("modify"); + $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save($this->dn); show_ldap_error($ldap->get_error(), _("Saving generic component failed")); - - /* Optionally execute a command after we're done */ - $this->postcreate(); } - } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 659b1910a..d08114902 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -245,7 +245,7 @@ class phoneGeneric extends plugin $this->netConfigDNS->remove_from_parent(); $ldap->rmdir($this->dn); show_ldap_error($ldap->get_error(), _("Removing phone failed")); - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); @@ -372,7 +372,7 @@ class phoneGeneric extends plugin $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); $ldap->cd($this->dn); $ldap->add($this->attrs); - $this->handle_post_events("add"); + $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } else { if ($this->orig_dn != $this->dn){ $this->move($this->orig_dn, $this->dn); @@ -391,14 +391,11 @@ class phoneGeneric extends plugin $usertab->save(); unset($usertab); } - $this->handle_post_events("modify"); + $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save($this->dn); show_ldap_error($ldap->get_error(), _("Saving phone failed")); - - /* Optionally execute a command after we're done */ - $this->postcreate(); } } diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 3a5a975c6..bb9d23c8d 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -576,7 +576,7 @@ class printgeneric extends plugin $this->netConfigDNS->remove_from_parent(); $ldap->rmdir($this->dn); show_ldap_error($ldap->get_error(), _("Removing printer failed")); - $this->handle_post_events("remove"); + $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); @@ -806,7 +806,7 @@ class printgeneric extends plugin } $ldap->add($this->attrs); - $this->handle_post_events("add"); + $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } else { if ($this->orig_dn != $this->dn){ $this->move($this->orig_dn, $this->dn); @@ -816,7 +816,7 @@ class printgeneric extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - $this->handle_post_events("modify"); + $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } show_ldap_error($ldap->get_error(), _("Saving printer failed")); @@ -827,9 +827,6 @@ class printgeneric extends plugin $this->netConfigDNS->save($this->dn); } - /* Optionally execute a command after we're done */ - $this->postcreate(); - /* This is a multi object. Handle tagging here... */ $this->handle_object_tagging(); } diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index cc756c73e..941ec08c7 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -209,7 +209,7 @@ class servgeneric extends plugin unset($og->member[$this->dn]); $og->save (); } - $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress)); + $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } @@ -318,7 +318,7 @@ class servgeneric extends plugin /* Optionally execute a command after we're done */ if(!$this->didAction){ - $this->handle_post_events($mode); + $this->handle_post_events($mode,array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } } diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 2ff3021eb..353ee0d32 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -324,7 +324,7 @@ class termgeneric extends plugin show_ldap_error($ldap->get_error(), _("Removing terminal failed")); /* Optionally execute a command after we're done */ - $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress)); + $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); @@ -485,12 +485,12 @@ class termgeneric extends plugin unset($this->attrs['gotoNtpServer']); } $ldap->add($this->attrs); - $this->handle_post_events("add"); + $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); - $this->handle_post_events("modify"); + $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } /* cn=default and macAddress=- indicates that this is a template */ @@ -501,9 +501,6 @@ class termgeneric extends plugin $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save($this->dn); show_ldap_error($ldap->get_error(), _("Saving terminal failed")); - - /* Optionally execute a command after we're done */ - $this->postcreate(); } } diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index a40eb9355..bc5217c17 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -296,7 +296,7 @@ class workgeneric extends plugin show_ldap_error($ldap->get_error(), _("Removing workstation failed")); /* Optionally execute a command after we're done */ - $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress)); + $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); @@ -448,7 +448,7 @@ class workgeneric extends plugin $ldap->add($this->attrs); show_ldap_error($ldap->get_error(), _("Saving workstation failed")); if(!$this->didAction){ - $this->handle_post_events("add"); + $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } } else { if ($this->orig_dn != $this->dn){ @@ -459,7 +459,7 @@ class workgeneric extends plugin $ldap->modify ($this->attrs); if(!$this->didAction){ - $this->handle_post_events("modify"); + $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } } -- 2.30.2