#!/usr/bin/env php . /** * @package GNUsocial * @copyright 2009 StatusNet, Inc. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ define('INSTALLDIR', dirname(__DIR__, 3)); define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public'); $shortoptions = "e:"; $helptext = <<user_id = $user->id; $confirm->address_type = 'email'; if ($confirm->find(true)) { $url = common_local_url( 'confirmfirstemail', ['code' => $confirm->code] ); print "$url\n"; } else { print "User not waiting for confirmation.\n"; } exit; } $user = User::register(array('nickname' => $nickname, 'password' => null)); $confirm = new Confirm_address(); $confirm->code = common_confirmation_code(128); $confirm->user_id = $user->id; $confirm->address = $email; $confirm->address_type = 'email'; $confirm->insert(); $url = common_local_url( 'confirmfirstemail', ['code' => $confirm->code] ); print "$url\n"; $confirm->sendConfirmation(['url'=>$url]);