From 61bd572a9c367ae70b0ac5c2cd20a1d459d08f1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Jun 2021 03:37:52 +0200 Subject: [PATCH] Fix token for ajax call --- htdocs/admin/system/perf.php | 14 ++++++++++---- htdocs/blockedlog/admin/blockedlog_list.php | 13 ++++++++----- htdocs/contact/list.php | 6 +++--- htdocs/core/ajax/pingresult.php | 4 +--- htdocs/core/class/html.form.class.php | 7 ++----- htdocs/core/js/lib_notification.js.php | 2 +- htdocs/core/tpl/ajax/fileupload_main.tpl.php | 7 +++++-- htdocs/loan/schedule.php | 3 ++- htdocs/main.inc.php | 17 ++++++++++------- htdocs/public/notice.php | 2 +- htdocs/takepos/floors.php | 20 ++++++++++---------- htdocs/takepos/index.php | 7 +++++-- htdocs/takepos/invoice.php | 5 +++-- htdocs/takepos/pay.php | 5 ++++- htdocs/takepos/send.php | 3 ++- 15 files changed, 67 insertions(+), 48 deletions(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 2a8dfa975cd..758a93a765d 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -172,7 +172,8 @@ jQuery(document).ready(function() { var compphpstring; getphpurl = $.ajax({ type: "GET", - url: \''.DOL_URL_ROOT.'/index.php\', + data: { token: \''.currentToken().'\' }, + url: \''.DOL_URL_ROOT.'/public/notice.php\', cache: false, /* async: false, */ /* crossDomain: true,*/ @@ -211,10 +212,11 @@ jQuery(document).ready(function() { var compcssstring; getcssurl = $.ajax({ type: "GET", + data: { token: \'notrequired\' }, url: \''.DOL_URL_ROOT.'/includes/jquery/css/base/jquery-ui.css\', cache: false, /* async: false, */ - /*crossDomain: true, */ + /* crossDomain: true, */ success: function () { cachecssstring=getcssurl.getResponseHeader(\'Cache-Control\'); /* alert(\'css:\'+getcssurl.getAllResponseHeaders()); */ @@ -250,10 +252,11 @@ jQuery(document).ready(function() { var compcssphpstring; getcssphpurl = $.ajax({ type: "GET", + data: { token: \''.currentToken().'\' }, url: \''.DOL_URL_ROOT.'/theme/eldy/style.css.php\', cache: false, /* async: false, */ - /*crossDomain: true,*/ + /* crossDomain: true,*/ success: function () { cachecssphpstring=getcssphpurl.getResponseHeader(\'Cache-Control\'); /* alert(\'cssphp:\'+getcssphpurl.getAllResponseHeaders()); */ @@ -289,10 +292,11 @@ jQuery(document).ready(function() { var compimgstring; getimgurl = $.ajax({ type: "GET", + data: { token: \'notrequired\' }, url: \''.DOL_URL_ROOT.'/theme/eldy/img/help.png\', cache: false, /* async: false, */ - /*crossDomain: true,*/ + /* crossDomain: true,*/ success: function () { cacheimgstring=getimgurl.getResponseHeader(\'Cache-Control\'); /* alert(\'img:\'+getimgurl.getAllResponseHeaders()); */ @@ -328,6 +332,7 @@ jQuery(document).ready(function() { var compjsstring; getjsurl = $.ajax({ type: "GET", + data: { token: \'notrequired\' }, url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\', cache: false, /* async: false, */ @@ -367,6 +372,7 @@ jQuery(document).ready(function() { var compjsphpstring; getjsphpurl = $.ajax({ type: "GET", + data: { token: \''.currentToken().'\' }, url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\', cache: false, /* async: false, */ diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 6b59c009ae7..265c12dd49c 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -613,8 +613,10 @@ jQuery(document).ready(function () { var fk_block = $(this).attr("data-blockid"); $.ajax({ - url:"../ajax/block-info.php?id="+fk_block - ,dataType:"html" + method: "GET", + data: { token: \''.currentToken().'\' }, + url: "'.DOL_URL_ROOT.'/blockedlog/ajax/block-info.php?id="+fk_block, + dataType: "html" }).done(function(data) { jQuery("#dialogforpopup").html(data); }); @@ -630,10 +632,11 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->glob