X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fregisteruser.php;h=b7ee9f368ca32aee845c4f429f18a966f5a87199;hb=b15f5f0cafc08c9b63090c5b4f7494fca0634238;hp=5d9c8862daf8f1d93681bb8a2bc8f3d47eb757b1;hpb=fc5002015b2a9e16a3c6b9992d55b45c73a8d2fb;p=quix0rs-gnu-social.git diff --git a/scripts/registeruser.php b/scripts/registeruser.php index 5d9c8862da..b7ee9f368c 100644 --- a/scripts/registeruser.php +++ b/scripts/registeruser.php @@ -34,7 +34,7 @@ registers a user in the database END_OF_REGISTERUSER_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; +require_once INSTALLDIR.'/scripts/commandline.inc.php'; $nickname = get_option_value('n', 'nickname'); $password = get_option_value('w', 'password'); @@ -49,7 +49,7 @@ if (empty($nickname) || empty($password)) { try { - $user = User::staticGet('nickname', $nickname); + $user = User::getKV('nickname', $nickname); if (!empty($user)) { throw new Exception("A user named '$nickname' already exists."); @@ -69,10 +69,8 @@ try { $user->email = $email; - if (!$user->updateKeys($orig)) { - print "Failed!\n"; - throw new Exception("Can't update email address."); - } + // Throws exception on failure. + $user->updateWithKeys($orig); } } catch (Exception $e) {