]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better logic in profile settings, missing method in all
authorEvan Prodromou <evan@controlezvous.ca>
Sun, 22 Jun 2008 15:23:06 +0000 (11:23 -0400)
committerEvan Prodromou <evan@controlezvous.ca>
Sun, 22 Jun 2008 15:23:06 +0000 (11:23 -0400)
darcs-hash:20080622152306-34904-3d3ab7c02c33efac17d02692a10b4fee2fb013f1.gz

actions/all.php
actions/profilesettings.php

index a8b08565aa83e1884fcaba3b08cdbfd08544c68e..c19440052f157b5e18eed24e7d7b22dc5450b947 100644 (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;
                }
 
index bca86a85f314fe93b4d0ff16bda67689fe5d3959..19157e9ca18e34782904f4fc63ca0b74d9f7fb3f 100644 (file)
@@ -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);