From: Evan Prodromou Date: Sun, 17 Apr 2011 22:27:25 +0000 (-0400) Subject: Yoink the registration action X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=45b0c5ef106ae71bbc335c516616f451d734b922;p=quix0rs-gnu-social.git Yoink the registration action --- diff --git a/plugins/EmailRegistration/EmailRegistrationPlugin.php b/plugins/EmailRegistration/EmailRegistrationPlugin.php index 3d868da69f..e23cb6dc34 100644 --- a/plugins/EmailRegistration/EmailRegistrationPlugin.php +++ b/plugins/EmailRegistration/EmailRegistrationPlugin.php @@ -62,26 +62,12 @@ class EmailRegistrationPlugin extends Plugin } } - /** - * Hijack main/register - */ - - function onStartConnectPath(&$path, &$defaults, &$rules, &$result) + function onArgsInitialize(&$args) { - static $toblock = array('main/register', 'main/register/:code'); - - if (in_array($path, $toblock) && $defaults['action'] != 'emailregister') { - return false; + if (array_key_exists('action', $args) && $args['action'] == 'register') { + // YOINK! + $args['action'] = 'emailregister'; } - - return true; - } - - function onStartInitializeRouter($m) - { - $m->connect('main/register', array('action' => 'emailregister')); - $m->connect('main/register/:code', array('action' => 'emailregister')); - return true; }