From 836a15663f477af65c794c64171940ff89e44366 Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 17 Sep 2014 11:24:40 +0200 Subject: [PATCH] sso fix for explorer/outlook --- webui/js.php | 19 +++++++++++ webui/ok.txt | 1 + webui/system/helper/detectmobilebrowser.php | 4 +-- webui/view/javascript/piler-in.js | 36 +++++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 webui/ok.txt diff --git a/webui/js.php b/webui/js.php index be7ac054..d82cbf62 100644 --- a/webui/js.php +++ b/webui/js.php @@ -7,6 +7,25 @@ $language = new Language(); $javascript = DIR_BASE . '/view/javascript/piler-in.js'; +/* + * some funky User-Agent scripts: + * + * + * - chrome: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36 + * + * - firefox: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0 + * + * - IE 11: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko + * + */ + + +if(OUTLOOK == 1 || strstr($_SERVER['HTTP_USER_AGENT'], " MSIE") || strstr($_SERVER['HTTP_USER_AGENT'], "Trident")) { + define('BROWSER_WITH_NTLM_BUG', 1); +} else { + define('BROWSER_WITH_NTLM_BUG', 0); +} + Header("Content-Type: text/javascript"); require_once($javascript); diff --git a/webui/ok.txt b/webui/ok.txt new file mode 100644 index 00000000..9766475a --- /dev/null +++ b/webui/ok.txt @@ -0,0 +1 @@ +ok diff --git a/webui/system/helper/detectmobilebrowser.php b/webui/system/helper/detectmobilebrowser.php index 76dd57aa..771e5670 100644 --- a/webui/system/helper/detectmobilebrowser.php +++ b/webui/system/helper/detectmobilebrowser.php @@ -1,6 +1,6 @@ diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index ac545c15..af0ec406 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -127,6 +127,8 @@ var Piler = { var url; + Piler.poor_mans_keepalive_for_dummy_browsers(); + Piler.Shared.type == 'search' ? url = '/search-helper.php' : url = '/audit-helper.php'; Piler.log("[load_search_results]", url); @@ -194,6 +196,8 @@ var Piler = { Piler.log("[saved_search_terms]"); + Piler.poor_mans_keepalive_for_dummy_browsers(); + jQuery.ajax( '/index.php?route=search/save', { data: $.extend(!0, { }, Piler.Shared, Piler.Searches[Piler.search], {save: '1'} ), type: "POST" @@ -270,6 +274,8 @@ var Piler = { var search = $('#_search').val(); + Piler.poor_mans_keepalive_for_dummy_browsers(); + Piler.log("[view_message]", id, search); jQuery.ajax('/message.php', { @@ -307,6 +313,8 @@ var Piler = { Piler.log("[not_spam]", id); + Piler.poor_mans_keepalive_for_dummy_browsers(); + jQuery.ajax('index.php?route=message/notspam', { data: { id: id }, type: "POST" @@ -329,6 +337,8 @@ var Piler = { Piler.log("[bulk_restore_messages]", email); + Piler.poor_mans_keepalive_for_dummy_browsers(); + var idlist = Piler.get_selected_messages_list(); if(!idlist) return; @@ -374,6 +384,8 @@ var Piler = { Piler.log("[add_note_to_message]", id, msg); + Piler.poor_mans_keepalive_for_dummy_browsers(); + jQuery.ajax('index.php?route=message/note', { data: { id: id, note: encodeURI($('#note').val()) }, type: "POST" @@ -389,6 +401,8 @@ var Piler = { Piler.log("[tag_search_results]", msg); + Piler.poor_mans_keepalive_for_dummy_browsers(); + var idlist = Piler.get_selected_messages_list(); Piler.log("[tag_search_results, idlist]", idlist); @@ -414,6 +428,8 @@ var Piler = { Piler.log("[load_url_to_preview_pane]", url); + Piler.poor_mans_keepalive_for_dummy_browsers(); + jQuery.ajax(url, { cache: true }) .done( function(a) { $('#mailpreviewframe').html(a); }) .fail(function(a, b) { alert("Problem retrieving XML data:" + b) }); @@ -764,6 +780,8 @@ var Piler = { Piler.log("[restore_message_for_recipients]", id); + Piler.poor_mans_keepalive_for_dummy_browsers(); + var z = $('#restorebox').children(), y = z.length, x; var emails = ''; @@ -972,6 +990,8 @@ var Piler = var folder_copy_url = '/index.php?route=folder/copy' + Piler.poor_mans_keepalive_for_dummy_browsers(); + jQuery.ajax('index.php?route=folder/copy', { data: { folder_id: folder_id, id: id }, type: "POST" @@ -1150,6 +1170,22 @@ var Piler = window.print(); document.body.innerHTML = oldPage; + }, + + + poor_mans_keepalive_for_dummy_browsers: function() + { + + + + Piler.log("[poor_mans_keepalive_for_dummy_browsers]"); + + jQuery.ajax('/ok.txt', { async: false }) + .done( function(a) { } ) + .fail(function(a, b) { alert("Problem retrieving XML data:" + b) }); + + + }