]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
check results of setting current user
authorEvan Prodromou <evan@prodromou.name>
Sat, 17 May 2008 19:30:30 +0000 (15:30 -0400)
committerEvan Prodromou <evan@prodromou.name>
Sat, 17 May 2008 19:30:30 +0000 (15:30 -0400)
darcs-hash:20080517193030-84dde-ecd85676afd34bd9eb4b42b84bb3b6a6b9ea6a9e.gz

actions/login.php
actions/register.php

index 60c95343f0ce4f717d7eec9ce0b82694e01fc5a9..293d07faed91f027fd3263bf45a276b28ad178a7 100644 (file)
@@ -38,7 +38,12 @@ class LoginAction extends Action {
                $nickname = $this->arg('nickname');
                $password = $this->arg('password');
                if (common_check_user($nickname, $password)) {
-                       common_set_user($nickname);
+                       # success!
+                       if (!common_set_user($nickname)) {
+                               common_server_error(_t('Error setting user.'));
+                               return;
+                       }
+                       # success!                      
                        common_redirect(common_local_url('all',
                                                                                         array('nickname' =>
                                                                                                   $nickname)));
index 29a7a70f7e103f8850661e7c166abf3e7e34382d..096eded79d8104945c29911ddc170bf7602e3a65 100644 (file)
@@ -51,7 +51,11 @@ class RegisterAction extends Action {
                } else if ($password != $confirm) {
                        $this->show_form(_t('Passwords don\'t match.'));
                } else if ($this->register_user($nickname, $password, $email)) {
-                       common_set_user($nickname);
+                       # success!
+                       if (!common_set_user($nickname)) {
+                               common_server_error(_t('Error setting user.'));
+                               return;
+                       }
                        common_redirect(common_local_url('profilesettings'));
                } else {
                        $this->show_form(_t('Invalid username or password.'));