summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/admin.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-12 15:28:03 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-12 15:28:03 -0700
commit87f8b6ff0a76f51183f14515723a8345f7c14fa6 (patch)
treea76c2faac252b835a11e467c7bb325bae2d8b6ed /modules/gallery/controllers/admin.php
parentdceecabbf1b736604ceb2e08e803b12c99dc4509 (diff)
Bounce the user to the login page if they try to get to part of the
admin site as a guest. Also, theme the login/html page.
Diffstat (limited to 'modules/gallery/controllers/admin.php')
-rw-r--r--modules/gallery/controllers/admin.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gallery/controllers/admin.php b/modules/gallery/controllers/admin.php
index 0aeaa876..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();