mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 23:21:59 +01:00
sso fix for explorer/outlook
This commit is contained in:
parent
1313ab520c
commit
836a15663f
19
webui/js.php
19
webui/js.php
@ -7,6 +7,25 @@ $language = new Language();
|
|||||||
|
|
||||||
$javascript = DIR_BASE . '/view/javascript/piler-in.js';
|
$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");
|
Header("Content-Type: text/javascript");
|
||||||
require_once($javascript);
|
require_once($javascript);
|
||||||
|
|
||||||
|
1
webui/ok.txt
Normal file
1
webui/ok.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
ok
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function is_mobile_device() {
|
function browser_detect() {
|
||||||
|
|
||||||
if(!isset($_SERVER['HTTP_USER_AGENT'])) { define('OUTLOOK', 0); return 0; }
|
if(!isset($_SERVER['HTTP_USER_AGENT'])) { define('OUTLOOK', 0); return 0; }
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ function is_mobile_device() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
define('MOBILE_DEVICE', is_mobile_device());
|
define('MOBILE_DEVICE', browser_detect());
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -127,6 +127,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
var url;
|
var url;
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
Piler.Shared.type == 'search' ? url = '/search-helper.php' : url = '/audit-helper.php';
|
Piler.Shared.type == 'search' ? url = '/search-helper.php' : url = '/audit-helper.php';
|
||||||
|
|
||||||
Piler.log("[load_search_results]", url);
|
Piler.log("[load_search_results]", url);
|
||||||
@ -194,6 +196,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
Piler.log("[saved_search_terms]");
|
Piler.log("[saved_search_terms]");
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
jQuery.ajax( '/index.php?route=search/save', {
|
jQuery.ajax( '/index.php?route=search/save', {
|
||||||
data: $.extend(!0, { }, Piler.Shared, Piler.Searches[Piler.search], {save: '1'} ),
|
data: $.extend(!0, { }, Piler.Shared, Piler.Searches[Piler.search], {save: '1'} ),
|
||||||
type: "POST"
|
type: "POST"
|
||||||
@ -270,6 +274,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
var search = $('#_search').val();
|
var search = $('#_search').val();
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
Piler.log("[view_message]", id, search);
|
Piler.log("[view_message]", id, search);
|
||||||
|
|
||||||
jQuery.ajax('/message.php', {
|
jQuery.ajax('/message.php', {
|
||||||
@ -307,6 +313,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
Piler.log("[not_spam]", id);
|
Piler.log("[not_spam]", id);
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
jQuery.ajax('index.php?route=message/notspam', {
|
jQuery.ajax('index.php?route=message/notspam', {
|
||||||
data: { id: id },
|
data: { id: id },
|
||||||
type: "POST"
|
type: "POST"
|
||||||
@ -329,6 +337,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
Piler.log("[bulk_restore_messages]", email);
|
Piler.log("[bulk_restore_messages]", email);
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
var idlist = Piler.get_selected_messages_list();
|
var idlist = Piler.get_selected_messages_list();
|
||||||
|
|
||||||
if(!idlist) return;
|
if(!idlist) return;
|
||||||
@ -374,6 +384,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
Piler.log("[add_note_to_message]", id, msg);
|
Piler.log("[add_note_to_message]", id, msg);
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
jQuery.ajax('index.php?route=message/note', {
|
jQuery.ajax('index.php?route=message/note', {
|
||||||
data: { id: id, note: encodeURI($('#note').val()) },
|
data: { id: id, note: encodeURI($('#note').val()) },
|
||||||
type: "POST"
|
type: "POST"
|
||||||
@ -389,6 +401,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
Piler.log("[tag_search_results]", msg);
|
Piler.log("[tag_search_results]", msg);
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
var idlist = Piler.get_selected_messages_list();
|
var idlist = Piler.get_selected_messages_list();
|
||||||
|
|
||||||
Piler.log("[tag_search_results, idlist]", idlist);
|
Piler.log("[tag_search_results, idlist]", idlist);
|
||||||
@ -414,6 +428,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
Piler.log("[load_url_to_preview_pane]", url);
|
Piler.log("[load_url_to_preview_pane]", url);
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
jQuery.ajax(url, { cache: true })
|
jQuery.ajax(url, { cache: true })
|
||||||
.done( function(a) { $('#mailpreviewframe').html(a); })
|
.done( function(a) { $('#mailpreviewframe').html(a); })
|
||||||
.fail(function(a, b) { alert("Problem retrieving XML data:" + b) });
|
.fail(function(a, b) { alert("Problem retrieving XML data:" + b) });
|
||||||
@ -764,6 +780,8 @@ var Piler =
|
|||||||
{
|
{
|
||||||
Piler.log("[restore_message_for_recipients]", id);
|
Piler.log("[restore_message_for_recipients]", id);
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
var z = $('#restorebox').children(), y = z.length, x;
|
var z = $('#restorebox').children(), y = z.length, x;
|
||||||
var emails = '';
|
var emails = '';
|
||||||
|
|
||||||
@ -972,6 +990,8 @@ var Piler =
|
|||||||
|
|
||||||
var folder_copy_url = '<?php print SITE_URL; ?>/index.php?route=folder/copy'
|
var folder_copy_url = '<?php print SITE_URL; ?>/index.php?route=folder/copy'
|
||||||
|
|
||||||
|
Piler.poor_mans_keepalive_for_dummy_browsers();
|
||||||
|
|
||||||
jQuery.ajax('index.php?route=folder/copy', {
|
jQuery.ajax('index.php?route=folder/copy', {
|
||||||
data: { folder_id: folder_id, id: id },
|
data: { folder_id: folder_id, id: id },
|
||||||
type: "POST"
|
type: "POST"
|
||||||
@ -1150,6 +1170,22 @@ var Piler =
|
|||||||
window.print();
|
window.print();
|
||||||
|
|
||||||
document.body.innerHTML = oldPage;
|
document.body.innerHTML = oldPage;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
poor_mans_keepalive_for_dummy_browsers: function()
|
||||||
|
{
|
||||||
|
|
||||||
|
<?php if(BROWSER_WITH_NTLM_BUG == 1 && ENABLE_SSO_LOGIN == 1) { ?>
|
||||||
|
|
||||||
|
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) });
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user