summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlezvous.ca>2008-06-22 11:23:06 -0400
committerEvan Prodromou <evan@controlezvous.ca>2008-06-22 11:23:06 -0400
commit785ea92bb7c9701eaf7f68e2d5621e53f5bce7f2 (patch)
tree63137ab132141ff40a52420ccd2c61cd3b5ac2c8
parentacf562b3ddaa6fbe1727fe301a50f1e9b5f26fd2 (diff)
better logic in profile settings, missing method in all
darcs-hash:20080622152306-34904-3d3ab7c02c33efac17d02692a10b4fee2fb013f1.gz
-rw-r--r--actions/all.php2
-rw-r--r--actions/profilesettings.php27
2 files changed, 14 insertions, 15 deletions
diff --git a/actions/all.php b/actions/all.php
index a8b08565a..c19440052 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -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;
}
diff --git a/actions/profilesettings.php b/actions/profilesettings.php
index bca86a85f..19157e9ca 100644
--- a/actions/profilesettings.php
+++ b/actions/profilesettings.php
@@ -114,22 +114,21 @@ class ProfilesettingsAction extends SettingsAction {
$user->query('BEGIN');
- 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;
- }
+ $original = clone($user);
+
+ $user->nickname = $nickname;
+
+ $result = $user->updateKeys($original);
+
+ 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);