123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- 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;
- require_once INSTALLDIR.'/scripts/commandline.inc';
- $email = $args[0];
- $sendWelcome = have_option('w', 'welcome');
- if ($sendWelcome && have_option('t', 'template')) {
- $template = get_option_value('t', 'template');
- }
- try {
- $confirm = DomainStatusNetworkPlugin::registerEmail($email);
- if ($sendWelcome) {
- EmailRegistrationPlugin::sendConfirmEmail($confirm, $template);
- }
- $confirmUrl = common_local_url('register', array('code' => $confirm->code));
- print $confirmUrl."\n";
- } catch (Exception $e) {
- print "ERROR: " . $e->getMessage() . "\n";
- }
|