From 45b0c5ef106ae71bbc335c516616f451d734b922 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 17 Apr 2011 18:27:25 -0400 Subject: [PATCH] Yoink the registration action --- .../EmailRegistrationPlugin.php | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) 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; }