summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/auth.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-02-10 09:55:39 -0800
committerBharat Mediratta <bharat@menalto.com>2010-02-10 09:55:39 -0800
commit592689a759a281a77aa2c622f199357eda43d9c2 (patch)
tree82f228a28d0c2a6ed78f51f7478a41ae0b1135b6 /modules/gallery/helpers/auth.php
parent6a40e0a341d84e792990b22b10375b80e41bf6ba (diff)
parent8ef08d20883d9b9aa0b7560ce3bf6da8a6632149 (diff)
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/auth.php')
-rw-r--r--modules/gallery/helpers/auth.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/gallery/helpers/auth.php b/modules/gallery/helpers/auth.php
index c3e9e6e9..f5454f85 100644
--- a/modules/gallery/helpers/auth.php
+++ b/modules/gallery/helpers/auth.php
@@ -130,4 +130,17 @@ class auth_Core {
$session->set("admin_area_activity_timestamp", time());
return false;
}
+
+ /**
+ * Redirect to the login page.
+ */
+ static function require_login() {
+ $view = new Theme_View("page.html", "other", "login");
+ $view->page_title = t("Log in to Gallery");
+ $view->content = new View("login_ajax.html");
+ $view->content->form = auth::get_login_form("login/auth_html");
+ // Avoid anti-phishing protection by passing the url as session variable.
+ Session::instance()->set("continue_url", url::current(true));
+ return $view;
+ }
} \ No newline at end of file