Fix token for ping

This commit is contained in:
Laurent Destailleur 2022-07-11 19:58:28 +02:00
parent 4f9211d3e5
commit 85a0ae1236
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2019-2022 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,7 +17,8 @@
/**
* \file htdocs/core/ajax/pingresult.php
* \brief File to save result of an anonymous ping into database (1 ping is done per installation)
* \brief Page called after a ping was done in js to the official dolibarr ping service.
* This ajax URL is called with parameter 'firstpingok' or 'firstpingko' depending on the result of the ping.
*/
if (!defined('NOTOKENRENEWAL')) {

View File

@ -3364,7 +3364,7 @@ if (!function_exists("llxFooter")) {
url: '<?php echo DOL_URL_ROOT.'/core/ajax/pingresult.php'; ?>',
timeout: 500, // timeout milliseconds
cache: false,
data: { hash_algo: 'md5', hash_unique_id: '<?php echo dol_escape_js($hash_unique_id); ?>', action: 'firstpingok', token: 'notrequired' }, // for update
data: { hash_algo: 'md5', hash_unique_id: '<?php echo dol_escape_js($hash_unique_id); ?>', action: 'firstpingok', token: '<?php echo currentToken(); ?>' }, // for update
});
},
error: function (data,status,xhr) { // error callback function
@ -3374,7 +3374,7 @@ if (!function_exists("llxFooter")) {
url: '<?php echo DOL_URL_ROOT.'/core/ajax/pingresult.php'; ?>',
timeout: 500, // timeout milliseconds
cache: false,
data: { hash_algo: 'md5', hash_unique_id: '<?php echo dol_escape_js($hash_unique_id); ?>', action: 'firstpingko', token: 'notrequired' },
data: { hash_algo: 'md5', hash_unique_id: '<?php echo dol_escape_js($hash_unique_id); ?>', action: 'firstpingko', token: '<?php echo currentToken(); ?>' },
});
}
});