summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/login.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-02-10 08:45:14 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-02-10 08:45:14 -0800
commit17f0a1b10f3df250129188316c14b01f0e3b45f0 (patch)
tree2a48f7b8409b63a0b3847aed8dfb6036d988d55c /modules/gallery/controllers/login.php
parentf6c615c379bb6950dacff34bfda73a616dce6e6b (diff)
If the user does not have permission to view the album, photo or movie, redirect
to a logon page to allow the user to login. Pass the target url as a session variable to allow the user to be redirected where they want to go if the login was successful. Fixes ticket #1009.
Diffstat (limited to 'modules/gallery/controllers/login.php')
-rw-r--r--modules/gallery/controllers/login.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php
index 5a08b693..093c15da 100644
--- a/modules/gallery/controllers/login.php
+++ b/modules/gallery/controllers/login.php
@@ -44,9 +44,10 @@ class Login_Controller extends Controller {
public function auth_html() {
access::verify_csrf();
+ $continue_url = Session::instance()->get("continue_url", null);
list ($valid, $form) = $this->_auth("login/auth_html");
if ($valid) {
- url::redirect(item::root()->abs_url());
+ url::redirect($continue_url ? $continue_url : item::root()->abs_url());
} else {
$view = new Theme_View("page.html", "other", "login");
$view->page_title = t("Log in to Gallery");