summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-17 15:30:30 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-17 15:30:30 -0400
commit6b308f0d1a3932cde5346cef509fdd49a8b626a4 (patch)
treea05c567759b54f12a8479734e31083ca30a3ff8f /actions
parent30089235e0c6e7008217f54cc4b65a686c4e0600 (diff)
check results of setting current user
darcs-hash:20080517193030-84dde-ecd85676afd34bd9eb4b42b84bb3b6a6b9ea6a9e.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/login.php7
-rw-r--r--actions/register.php6
2 files changed, 11 insertions, 2 deletions
diff --git a/actions/login.php b/actions/login.php
index 60c95343f..293d07fae 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -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)));
diff --git a/actions/register.php b/actions/register.php
index 29a7a70f7..096eded79 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -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.'));