$this->show_form(_t('Not a valid email address.'));
return;
} else if (!Validate::string($nickname, array('min_length' => 1,
$this->show_form(_t('Not a valid email address.'));
return;
} else if (!Validate::string($nickname, array('min_length' => 1,
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
$this->show_form(_t('Nickname must have only letters and numbers and no spaces.'));
return;
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
$this->show_form(_t('Nickname must have only letters and numbers and no spaces.'));
return;
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
!Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) {
$this->show_form(_t('Homepage is not a valid URL.'));
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
!Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) {
$this->show_form(_t('Homepage is not a valid URL.'));
- $original = clone($user);
-
- $user->nickname = $nickname;
+ if ($user->nickname != $nickname) {
+
+ common_debug('Updating user nickname from ' . $user->nickname . ' to ' . $nickname,
+ __FILE__);
+
+ $original = clone($user);
- if ($result === FALSE) {
- 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;
+ }
# XXX: try not to do this in the middle of a transaction
mail_confirm_address($confirm->code,
# XXX: try not to do this in the middle of a transaction
mail_confirm_address($confirm->code,