all updates use original now

darcs-hash:20080519122708-84dde-78ec2e47aeb4b33fb83c7d8f5e7f3735d66055ae.gz
This commit is contained in:
Evan Prodromou 2008-05-19 08:27:08 -04:00
parent 2080f52cb1
commit 3a2d17f9f6
2 changed files with 32 additions and 28 deletions

View File

@ -66,9 +66,11 @@ class PasswordAction extends SettingsAction {
return;
}
$original = clone($user);
$user->password = common_munge_password($newpassword, $user->id);
if (!$user->update()) {
if (!$user->update($original)) {
common_server_error(_t('Can\'t save new password.'));
return;
}

View File

@ -80,6 +80,8 @@ class ProfilesettingsAction extends SettingsAction {
$profile = $user->getProfile();
$orig_profile = clone($profile);
$profile->nickname = $user->nickname;
$profile->fullname = $this->arg('fullname');
$profile->homepage = $this->arg('homepage');
@ -87,7 +89,7 @@ class ProfilesettingsAction extends SettingsAction {
$profile->location = $this->arg('location');
$profile->profileurl = common_profile_url($nickname);
if (!$profile->update()) {
if (!$profile->update($orig_profile)) {
common_server_error(_t('Couldnt save profile.'));
return;
}