diff options
author | Brion Vibber <brion@pobox.com> | 2010-05-21 13:12:25 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-05-21 13:12:25 -0700 |
commit | 87b8a89aa7b96e63586bdd3b1afb9d43355fd48b (patch) | |
tree | ef227ad50cd25699d34dd1a3364ac0cf430443da /lib/profileformaction.php | |
parent | a39a934dd4a133bad6e76fa9a5018cedcb70225c (diff) | |
parent | bbfd6eff0c69f038d151d3bf6c8bf9b45a64716f (diff) |
Merge branch 'master' of gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'lib/profileformaction.php')
-rw-r--r-- | lib/profileformaction.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/profileformaction.php b/lib/profileformaction.php index 0ffafe5fb..51c89a922 100644 --- a/lib/profileformaction.php +++ b/lib/profileformaction.php @@ -60,7 +60,16 @@ class ProfileFormAction extends RedirectingAction $this->checkSessionToken(); if (!common_logged_in()) { - $this->clientError(_('Not logged in.')); + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $this->clientError(_('Not logged in.')); + } else { + // Redirect to login. + common_set_returnto($this->selfUrl()); + $user = common_current_user(); + if (Event::handle('RedirectToLogin', array($this, $user))) { + common_redirect(common_local_url('login'), 303); + } + } return false; } @@ -97,7 +106,7 @@ class ProfileFormAction extends RedirectingAction if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->handlePost(); - $this->returnToArgs(); + $this->returnToPrevious(); } } |