better logic in profile settings, missing method in all

darcs-hash:20080622152306-34904-3d3ab7c02c33efac17d02692a10b4fee2fb013f1.gz
This commit is contained in:
Evan Prodromou 2008-06-22 11:23:06 -04:00
parent acf562b3dd
commit 785ea92bb7
2 changed files with 14 additions and 15 deletions

View File

@ -31,7 +31,7 @@ class AllAction extends StreamAction {
$user = User::staticGet('nickname', $nickname);
if (!$user) {
$this->no_such_user();
$this->client_error(_t('No such user: ') . $nickname);
return;
}

View File

@ -114,22 +114,21 @@ class ProfilesettingsAction extends SettingsAction {
$user->query('BEGIN');
if ($user->nickname != $nickname) {
$original = clone($user);
$original = clone($user);
$user->nickname = $nickname;
$user->nickname = $nickname;
$result = $user->updateKeys($original);
$result = $user->updateKeys($original);
if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__);
common_server_error(_t('Couldnt update user.'));
return;
}
if ($result === FALSE) {
common_log_db_error($user, 'UPDATE', __FILE__);
common_server_error(_t('Couldnt update user.'));
return;
}
if ($email != $user->email) {
if ($user->email != $email) {
# We don't update email directly; it gets done by confirmemail
$confirm = new Confirm_email();
$confirm->code = common_good_rand(16);