From 995e592a3d7e6b6778c2c3a2e9bed8e087252f57 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Sat, 13 Feb 2010 18:03:46 -0800 Subject: Change JavaScript reauthentication check to check via XHR. Benefit: Getting the real deadline this way, not interfering with an ongoing maintenance task. --- modules/gallery/helpers/gallery_theme.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'modules/gallery/helpers/gallery_theme.php') 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 = ''; + 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); + '; print $admin_session_redirect_check; if ($session->get("l10n_mode", false)) { -- cgit v1.2.3