X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fregisteruser.php;h=97caf645cd6eb812904d9c68da110e958e30ca49;hb=c285f80b1830cffd20a28c693d74c59f8c3c39f6;hp=8aab325b797f94a3413a19b322a364010d0771c8;hpb=ec6a38a62786c85e8ee30c5726ea81f82465b39d;p=quix0rs-gnu-social.git diff --git a/scripts/registeruser.php b/scripts/registeruser.php old mode 100644 new mode 100755 index 8aab325b79..97caf645cd --- a/scripts/registeruser.php +++ b/scripts/registeruser.php @@ -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."); @@ -60,7 +60,7 @@ try { 'fullname' => $fullname)); if (empty($user)) { - throw new Exception("Cannot register user '$nickname' with password '$password' and fullname '$fullname'."); + throw new Exception("Can't register user '$nickname' with password '$password' and fullname '$fullname'."); } if (!empty($email)) { @@ -69,10 +69,8 @@ try { $user->email = $email; - if (!$user->updateKeys($orig)) { - print "Failed!\n"; - throw new Exception("Cannot update email address."); - } + // Throws exception on failure. + $user->updateWithKeys($orig); } } catch (Exception $e) {