Merge branch '1.0.x' into testing

This commit is contained in:
Evan Prodromou
2011-05-04 13:05:06 -07:00
8 changed files with 91 additions and 61 deletions

View File

@@ -22,8 +22,16 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
$shortoptions = 'wt::';
$longoptions = array('welcome', 'template=');
$helptext = <<<END_OF_INSTALLFOREMAIL_HELP
installforemail.php [options] <email address>
Create a new account and, if necessary, a new network for the given email address
-w --welcome Send a welcome email
-t --template= Use this email template
END_OF_INSTALLFOREMAIL_HELP;
@@ -54,6 +62,16 @@ StatusNet::switchSite($sn->nickname);
$confirm = EmailRegistrationPlugin::registerEmail($email);
if (have_option('w', 'welcome')) {
if (have_option('t', 'template')) {
// use the provided template
EmailRegistrationPlugin::sendConfirmEmail($confirm, get_option_value('t', 'template'));
} else {
// use the default template
EmailRegistrationPlugin::sendConfirmEmail($confirm);
}
}
$confirmUrl = common_local_url('register', array('code' => $confirm->code));
print $confirmUrl."\n";