summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-02-14 07:11:14 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-02-14 07:11:14 -0800
commite41a2d4e5226c45a5201df91ca6633a40b357630 (patch)
treef7c06e2c2495c833028dfcffd1ef90447047b586 /modules/gallery/helpers
parentdcd7a8fbb8924665a07582aa53f07a86ef922287 (diff)
parentdf8273e3f26f35ad87fd6f96610f370bdad7f1e5 (diff)
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_theme.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php
index 9ffeb911..ec650e1c 100644
--- a/modules/gallery/helpers/gallery_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -92,13 +92,18 @@ class gallery_theme_Core {
}
// 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>';
+ var adminReauthCheck = function() {
+ $.ajax({url: "' . url::site("admin?reauth_check=1") . '",
+ dataType: "json",
+ success: function(data){
+ if ("location" in data) {
+ document.location = data.location;
+ }
+ }});
+ };
+ setInterval("adminReauthCheck();", 60 * 1000);
+ </script>';
print $admin_session_redirect_check;
if ($session->get("l10n_mode", false)) {