diff options
-rw-r--r-- | inc/actions.php | 6 | ||||
-rw-r--r-- | inc/events.php | 14 | ||||
-rw-r--r-- | inc/html.php | 6 |
3 files changed, 18 insertions, 8 deletions
diff --git a/inc/actions.php b/inc/actions.php index a14cb385f..8d7479d0e 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -14,6 +14,9 @@ * Call the needed action handlers * * @author Andreas Gohr <andi@splitbrain.org> + * @triggers ACTION_ACT_PREPROCESS + * @triggers ACTION_REGISTER + * @triggers ACTION_HEADERS_SEND */ function act_dispatch(){ global $INFO; @@ -48,7 +51,8 @@ function act_dispatch(){ $ACT = act_permcheck($ACT); //register - if($ACT == 'register' && register()){ + $nil = array(); + if($ACT == 'register' && $_POST['save'] && trigger_event('ACTION_REGISTER', $nil, 'register')){ $ACT = 'login'; } diff --git a/inc/events.php b/inc/events.php index ddb0eb277..5caba5cff 100644 --- a/inc/events.php +++ b/inc/events.php @@ -62,7 +62,7 @@ class Doku_Event { function advise_after() { global $EVENT_HANDLER; - $this->_continue = true; + $this->_continue = true; $EVENT_HANDLER->process_event($this,'AFTER'); } @@ -71,7 +71,7 @@ class Doku_Event { * * - advise all registered (<event>_BEFORE) handlers that this event is about to take place * - carry out the default action using $this->data based on $enablePrevent and - * $this->_default, all of which may have been modified by the event handlers. + * $this->_default, all of which may have been modified by the event handlers. * - advise all registered (<event>_AFTER) handlers that the event has taken place * * @return $event->results @@ -91,9 +91,9 @@ class Doku_Event { $this->result = $action($this->data); } } - + $this->advise_after(); - + return $this->result; } @@ -103,7 +103,7 @@ class Doku_Event { * stop any further processing of the event by event handlers * this function does not prevent the default action taking place */ - function stopPropagation() { $this->_continue = false; } + function stopPropagation() { $this->_continue = false; } /** * preventDefault @@ -145,11 +145,11 @@ class Doku_Event_Handler { * register a hook for an event * * @PARAM $event (string) name used by the event, (incl '_before' or '_after' for triggers) - * @PARAM $obj (obj) object in whose scope method is to be executed, + * @PARAM $obj (obj) object in whose scope method is to be executed, * if NULL, method is assumed to be a globally available function * @PARAM $method (function) event handler function * @PARAM $param (mixed) data passed to the event handler - */ + */ function register_hook($event, $advise, &$obj, $method, $param=NULL) { $this->_hooks[$event.'_'.$advise][] = array(&$obj, $method, $param); } diff --git a/inc/html.php b/inc/html.php index 8fb516598..85349b633 100644 --- a/inc/html.php +++ b/inc/html.php @@ -909,6 +909,7 @@ function html_msgarea(){ * Prints the registration form * * @author Andreas Gohr <andi@splitbrain.org> + * @triggers HTML_REGISTERFORM_INJECTION */ function html_register(){ global $lang; @@ -952,6 +953,10 @@ function html_register(){ <?php echo $lang['email']?> <input type="text" name="email" class="edit" size="50" value="<?php echo formText($_POST['email'])?>" /> </label><br /> + <?php //bad and dirty event insert hook + $evdata = array(); + trigger_event('HTML_REGISTERFORM_INJECTION', $evdata); + ?> <input type="submit" class="button" value="<?php echo $lang['register']?>" /> </fieldset> </form> @@ -1029,6 +1034,7 @@ function html_updateprofile(){ * * @fixme this is a huge lump of code and should be modularized * @triggers HTML_PAGE_FROMTEMPLATE + * @triggers HTML_EDITFORM_INJECTION * @author Andreas Gohr <andi@splitbrain.org> */ function html_edit($text=null,$include='edit'){ //FIXME: include needed? |