summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/gallery.php15
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";
+ }
}
}