mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 18:40:13 +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';
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
|
1
webui/ok.txt
Normal file
1
webui/ok.txt
Normal file
@ -0,0 +1 @@
|
||||
ok
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
function is_mobile_device() {
|
||||
function browser_detect() {
|
||||
|
||||
if(!isset($_SERVER['HTTP_USER_AGENT'])) { define('OUTLOOK', 0); return 0; }
|
||||
|
||||
@ -11,7 +11,7 @@ function is_mobile_device() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
define('MOBILE_DEVICE', is_mobile_device());
|
||||
define('MOBILE_DEVICE', browser_detect());
|
||||
|
||||
|
||||
?>
|
||||
|
@ -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 = '<?php print SITE_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()
|
||||
{
|
||||
|
||||
<?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