Yoink the registration action
This commit is contained in:
parent
064ed69446
commit
45b0c5ef10
|
@ -62,26 +62,12 @@ class EmailRegistrationPlugin extends Plugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function onArgsInitialize(&$args)
|
||||||
* Hijack main/register
|
|
||||||
*/
|
|
||||||
|
|
||||||
function onStartConnectPath(&$path, &$defaults, &$rules, &$result)
|
|
||||||
{
|
{
|
||||||
static $toblock = array('main/register', 'main/register/:code');
|
if (array_key_exists('action', $args) && $args['action'] == 'register') {
|
||||||
|
// YOINK!
|
||||||
if (in_array($path, $toblock) && $defaults['action'] != 'emailregister') {
|
$args['action'] = 'emailregister';
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onStartInitializeRouter($m)
|
|
||||||
{
|
|
||||||
$m->connect('main/register', array('action' => 'emailregister'));
|
|
||||||
$m->connect('main/register/:code', array('action' => 'emailregister'));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user