summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/admin.php')
-rw-r--r--modules/gallery/controllers/admin.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gallery/controllers/admin.php b/modules/gallery/controllers/admin.php
index 787a2138..c460f58c 100644
--- a/modules/gallery/controllers/admin.php
+++ b/modules/gallery/controllers/admin.php
@@ -22,7 +22,12 @@ class Admin_Controller extends Controller {
public function __construct($theme=null) {
if (!identity::active_user()->admin) {
- access::forbidden();
+ if (identity::active_user()->guest) {
+ Session::instance()->set("continue_url", url::abs_current(true));
+ url::redirect("login");
+ } else {
+ access::forbidden();
+ }
}
parent::__construct();
@@ -78,7 +83,7 @@ class Admin_Controller extends Controller {
private static function _prompt_for_reauth($controller_name, $args) {
if (request::method() == "get" && !request::is_ajax()) {
// Avoid anti-phishing protection by passing the url as session variable.
- Session::instance()->set("continue_url", url::current(true));
+ Session::instance()->set("continue_url", url::abs_current(true));
}
url::redirect("reauthenticate");
}