Move business logic of email registration to plugin

Moved the main business logic of email registration to the
EmailRegistrationPlugin. That lets us register from a script, from the
emailregister account, or (hopefully) from the signup page.
This commit is contained in:
Evan Prodromou
2011-04-21 10:15:51 -04:00
parent 2e93d5e551
commit 10cffa8afa
3 changed files with 105 additions and 60 deletions

View File

@@ -21,7 +21,11 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
$helptext = <<<END_OF_REGISTEREMAILUSER_HELP
registeremailuser.php [options] <email>
registeremailuser.php [options] <email address>
Options:
-e --email Send a confirmation message to the email address
register a new user by email address.
END_OF_REGISTEREMAILUSER_HELP;
@@ -35,6 +39,11 @@ if (count($args) == 0) {
$email = $args[0];
$confirm = EmailRegistrationPlugin::registerEmail($email);
if (have_option('e', 'email')) {
EmailRegistrationPlugin::sendConfirmEmail($confirm);
}
$confirmUrl = common_local_url('register', array('code' => $confirm->code));
print $confirmUrl."\n";