summaryrefslogtreecommitdiff
path: root/actions/profilesettings.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/profilesettings.php')
-rw-r--r--actions/profilesettings.php26
1 files changed, 15 insertions, 11 deletions
diff --git a/actions/profilesettings.php b/actions/profilesettings.php
index 1b7c75d47..bca86a85f 100644
--- a/actions/profilesettings.php
+++ b/actions/profilesettings.php
@@ -113,20 +113,23 @@ class ProfilesettingsAction extends SettingsAction {
assert(!is_null($user)); # should already be checked
$user->query('BEGIN');
-
- $original = clone($user);
-
- $user->nickname = $nickname;
- $result = $user->update($original);
-
- if (!$result) {
- common_log_db_error($user, 'UPDATE', __FILE__);
- common_server_error(_t('Couldnt update user.'));
- return;
+ if ($user->nickname != $nickname) {
+
+ $original = clone($user);
+
+ $user->nickname = $nickname;
+
+ $result = $user->updateKeys($original);
+
+ if (!$result) {
+ common_log_db_error($user, 'UPDATE', __FILE__);
+ common_server_error(_t('Couldnt update user.'));
+ return;
+ }
}
- if ($email != $original->email) {
+ if ($email != $user->email) {
$confirm = new Confirm_email();
$confirm->code = common_good_rand(16);
@@ -134,6 +137,7 @@ class ProfilesettingsAction extends SettingsAction {
$confirm->email = $email;
$result = $confirm->insert();
+
if (!$result) {
common_log_db_error($confirm, 'INSERT', __FILE__);
common_server_error(_t('Couldnt confirm email.'));