From: hickert Date: Wed, 28 Jul 2010 14:12:42 +0000 (+0000) Subject: Updated pre-events X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c85ff29f598a9363ca97452b967e687a89243266;p=gosa.git Updated pre-events git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@19189 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/Changelog b/gosa-core/Changelog index cbafea222..718728f77 100644 --- a/gosa-core/Changelog +++ b/gosa-core/Changelog @@ -2,7 +2,7 @@ GOsa2 changelog =============== * gosa 2.6.11 - - Updated post-event handling and added pre-post-event hooks. + - Updated post-event handling and added pre-events. - Updated sudoers plugin, to allow special chars. - Updated samba flags and account expiration. - Samba password hashs can now be disabled by removing 'sambaHashHook' from gosa.conf. diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 93ec6a9e9..a728b97f0 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -311,7 +311,7 @@ class plugin $ldap->modify($this->attrs); */ if($this->initially_was_account){ - $this->handle_prepost_events('remove'); + $this->handle_pre_events('remove'); } } @@ -396,9 +396,9 @@ class plugin $this->tag_attrs($this->attrs); if($this->is_new){ - $this->handle_prepost_events('add'); + $this->handle_pre_events('add'); }else{ - $this->handle_prepost_events('modify'); + $this->handle_pre_events('modify'); } } @@ -1181,23 +1181,23 @@ class plugin /*! \brief Forward command execution requests * to the hook execution method. */ - function handle_prepost_events($mode, $addAttrs= array()) + function handle_pre_events($mode, $addAttrs= array()) { if(!in_array($mode, array('add','remove','modify'))){ - trigger_error(sprintf("Invalid pre-post event type given %s! Valid types are [add,modify,remove].", $mode)); + trigger_error(sprintf("Invalid pre event type given %s! Valid types are [add,modify,remove].", $mode)); return; } switch ($mode){ case "add": - plugin::callHook($this,"PREPOSTCREATE", $addAttrs); + plugin::callHook($this,"PRECREATE", $addAttrs); break; case "modify": - plugin::callHook($this,"PREPOSTMODIFY", $addAttrs); + plugin::callHook($this,"PREMODIFY", $addAttrs); break; case "remove": - plugin::callHook($this,"PREPOSTREMOVE", $addAttrs); + plugin::callHook($this,"PREREMOVE", $addAttrs); break; } }