summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2010-02-07 16:44:07 -0800
committerAndy Staudacher <andy.st@gmail.com>2010-02-07 16:44:07 -0800
commit8fc346e9b67204c31e2bfeb59a5cbaa49e308085 (patch)
treef9e90a6644e1960679b02f3499e04d90adc8fed2 /modules/gallery/helpers
parent0c5402fe0a288335f1662552026da5ffb756b13b (diff)
Addendum for ticket 585: Handle case C), redirect the admin to a non-admin page when the admin area session expires, before the admin has a chance to send an XHR admin request, for which we wouldn't have a good answer.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_theme.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php
index 0018fd9a..9ffeb911 100644
--- a/modules/gallery/helpers/gallery_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -90,6 +90,17 @@ class gallery_theme_Core {
$profiler = new Profiler();
$profiler->render();
}
+
+ // Redirect to the root album when the admin session expires.
+ $redirect_url = url::abs_site("");
+ $admin_area_timeout = 1000 * module::get_var("gallery", "admin_area_timeout");
+ $admin_session_redirect_check = '<script type="text/javascript">
+ var page_loaded_timestamp = new Date();
+ setInterval("if (new Date() - page_loaded_timestamp > ' . $admin_area_timeout .
+ ') document.location = \'' . $redirect_url . '\';", 60 * 1000);
+ </script>';
+ print $admin_session_redirect_check;
+
if ($session->get("l10n_mode", false)) {
return L10n_Client_Controller::l10n_form();
}