try {
- $user = User::staticGet('nickname', $nickname);
+ $user = User::getKV('nickname', $nickname);
if (!empty($user)) {
throw new Exception("A user named '$nickname' already exists.");
'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)) {
$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) {