From: Evan Prodromou Date: Mon, 2 Nov 2009 22:28:03 +0000 (-0500) Subject: script to register a user X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eee033ae7c78568129e7c35c9846e2be8800f4c2;p=quix0rs-gnu-social.git script to register a user --- diff --git a/scripts/registeruser.php b/scripts/registeruser.php new file mode 100644 index 0000000000..9857f5aeea --- /dev/null +++ b/scripts/registeruser.php @@ -0,0 +1,81 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'n:w:f:e:'; +$longoptions = array('nickname=', 'password=', 'fullname=', 'email='); + +$helptext = << $nickname, + 'password' => $password, + 'fullname' => $fullname)); + + if (empty($user)) { + throw new Exception("Can't register user '$nickname' with password '$password' and fullname '$fullname'."); + } + + if (!empty($email)) { + + $orig = clone($user); + + $user->email = $email; + + if (!$user->updateKeys($orig)) { + print "Failed!\n"; + throw new Exception("Can't update email address."); + } + } + +} catch (Exception $e) { + print $e->getMessage() . "\n"; + exit(1); +}