/**
  * Handler method
  *
  * @param array $argarray is ignored since it's now passed in in prepare()
  *
  * @return void
  */
 function handle($argarray = null)
 {
     try {
         $confirm = DomainStatusNetworkPlugin::registerEmail($this->email);
         EmailRegistrationPlugin::sendConfirmEmail($confirm);
         $this->showSuccess();
     } catch (ClientException $e) {
         $this->showError($e->getMessage(), $e->getCode());
     } catch (Exception $e) {
         common_log(LOG_ERR, $e->getMessage());
         $this->showError(_('An internal error occurred.'), 500);
     }
     return;
 }
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
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";
}
 function registerUser()
 {
     try {
         $confirm = EmailRegistrationPlugin::registerEmail($this->email);
     } catch (ClientException $ce) {
         $this->error = $ce->getMessage();
         $this->showRegistrationForm();
         return;
     }
     EmailRegistrationPlugin::sendConfirmEmail($confirm);
     // TRANS: Confirmation text after initial registration.
     // TRANS: %s an e-mail address.
     $prompt = sprintf(_m('An email was sent to %s to confirm that address. Check your email inbox for instructions.'), $this->email);
     $this->complete = $prompt;
     $this->showPage();
 }
 */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
$shortoptions = 'wt::';
$longoptions = array('welcome', 'template=');
$helptext = <<<END_OF_REGISTEREMAILUSER_HELP
registeremailuser.php [options] <email address>

Options:
-w --welcome   Send a welcome email
-t --template= Use this email template

register a new user by email address.

END_OF_REGISTEREMAILUSER_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
if (count($args) == 0) {
    show_help();
}
$email = $args[0];
$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";