From f5dac49330f4a0443c88dc82f0145c1bc4bdf031 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 16 Dec 2015 12:55:41 +0100 Subject: [PATCH] Don't fire application-state requests if not authenticated fixes #10749 --- application/controllers/ApplicationStateController.php | 2 +- public/js/icinga/behavior/application-state.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/controllers/ApplicationStateController.php b/application/controllers/ApplicationStateController.php index 69f643438..873c599bf 100644 --- a/application/controllers/ApplicationStateController.php +++ b/application/controllers/ApplicationStateController.php @@ -20,7 +20,7 @@ class ApplicationStateController extends Controller $last = 0; } $now = time(); - if ($last + 60 < $now) { + if ($last + 600 < $now) { Session::getSession()->write(); $params = session_get_cookie_params(); setcookie( diff --git a/public/js/icinga/behavior/application-state.js b/public/js/icinga/behavior/application-state.js index e989da389..73c62e416 100644 --- a/public/js/icinga/behavior/application-state.js +++ b/public/js/icinga/behavior/application-state.js @@ -16,8 +16,9 @@ ApplicationState.prototype = new Icinga.EventListener(); ApplicationState.prototype.onRendered = function(e) { - var _this = e.data.self; - if (! $('#application-state').length) { + if (! $('#application-state').length && ! $('#login').length && ! $('#guest-error').length) { + var _this = e.data.self; + $('#layout').append( '