diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2010-09-07 18:53:25 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-09-07 18:53:25 -0700 |
| commit | 5a26dd542a3cb4974870bcfeec4864d1daa616c4 (patch) | |
| tree | dede0baa9ba893a4987bffc7ddaf925694e5ddde /modules/gallery/helpers/gallery.php | |
| parent | b6fa33faf789749f4de3f4eadf8832748372c980 (diff) | |
| parent | d398651c080c18e4f1bf623548091465dac1d528 (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/gallery.php')
| -rw-r--r-- | modules/gallery/helpers/gallery.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 924ee76a..9430231c 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -45,10 +45,17 @@ class gallery_Core { Router::$controller != "combined" && identity::active_user()->guest && !access::user_can(identity::guest(), "view", item::root())) { - Session::instance()->set("continue_url", url::abs_current()); - Router::$controller = "login"; - Router::$controller_path = MODPATH . "gallery/controllers/login.php"; - Router::$method = "html"; + if (Router::$controller == "admin") { + // At this point we're in the admin theme and it doesn't have a themed login page, so + // we can't just swap in the login controller and have it work. So redirect back to the + // root item where we'll run this code again with the site theme. + url::redirect(item::root()->abs_url()); + } else { + Session::instance()->set("continue_url", url::abs_current()); + Router::$controller = "login"; + Router::$controller_path = MODPATH . "gallery/controllers/login.php"; + Router::$method = "html"; + } } } |
