Fix ping
This commit is contained in:
parent
5ee9a88181
commit
a6fdec5713
@ -2320,15 +2320,15 @@ if (! function_exists("llxFooter"))
|
||||
print "\n<!-- A div to allow dialog popup -->\n";
|
||||
print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
|
||||
|
||||
// Add code for the fist asynchronous anonymous ping
|
||||
// Add code for the asynchronous anonymous first ping (for telemetry)
|
||||
if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha'))
|
||||
{
|
||||
if (empty($conf->global->MAIN_FIRST_PING_OK_DATE)
|
||||
|| (! empty($conf->file->instance_unique_id) && $conf->file->instance_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID)
|
||||
|| (! empty($conf->file->instance_unique_id) && (md5($conf->file->instance_unique_id) != $conf->global->MAIN_FIRST_PING_OK_ID))
|
||||
|| GETPOST('forceping', 'alpha'))
|
||||
{
|
||||
print "\n".'<!-- Includes JS for Ping of Dolibarr -->'."\n";
|
||||
print "\n<!-- JS CODE TO ENABLE the First anonymous Ping -->\n";
|
||||
print "\n".'<!-- Includes JS for Ping of Dolibarr MAIN_FIRST_PING_OK_DATE = '.$conf->global->MAIN_FIRST_PING_OK_DATE.' MAIN_FIRST_PING_OK_ID = '.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'."\n";
|
||||
print "\n<!-- JS CODE TO ENABLE the anonymous Ontime Ping -->\n";
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function (tmp) {
|
||||
@ -2337,12 +2337,9 @@ if (! function_exists("llxFooter"))
|
||||
url: "https://ping.dolibarr.org/",
|
||||
timeout: 500, // timeout milliseconds
|
||||
cache: false,
|
||||
xhrFields: {
|
||||
withCredentials: true
|
||||
},
|
||||
data: { hash_algo: "md5", hash_unique_id: "<?php echo md5($conf->file->instance_unique_id); ?>", action: "dolibarrping", entity: <?php echo (int) $conf->entity; ?> },
|
||||
success: function (data,status,xhr) { // success callback function
|
||||
console.log("Ping ok: " + data);
|
||||
success: function (data, status, xhr) { // success callback function (data contains body of response)
|
||||
console.log("Ping ok");
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: "<?php echo DOL_URL_ROOT.'/core/ajax/pingresult.php'; ?>",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user