diff options
| author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-07 08:41:25 +0300 |
|---|---|---|
| committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-07 08:41:25 +0300 |
| commit | ba950bec0c84a1467aa2545ca815d5af7b0b002b (patch) | |
| tree | 307cdacf0ece60ae9b2db94ad43fcf00d769dcfc /modules/gallery/helpers/gallery.php | |
| parent | 9572c664d2bfff0877d4f2062eb0ef6665a109cf (diff) | |
| parent | 7c80bc0c3db1ca20ce424a36a05f1337de9e1e31 (diff) | |
Merge remote branch 'gallery3/master'
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"; + } } } |
