2
0
forked from Wavyzz/dolibarr

Fix do not ping name of server

This commit is contained in:
Laurent Destailleur
2019-11-27 11:38:30 +01:00
parent 9a9a43fc4d
commit c22fea52e5
3 changed files with 8 additions and 4 deletions

View File

@@ -42,11 +42,11 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$lan
print "\n"; print "\n";
// Recupere l'OS au sens PHP // Recupere l'OS au sens PHP
print "<tr $bc[0]><td width=\"240\">".$langs->trans("PHP_OS")."</td><td>".PHP_OS."</td></tr>\n"; print '<tr class="oddeven"><td>'.$langs->trans("PHP_OS")."</td><td>".PHP_OS."</td></tr>\n";
// Recupere la version de l'OS // Recupere la version de l'OS
$osversion=version_os(); $osversion=version_os();
print "<tr $bc[1]><td width=\"240\">".$langs->trans("Version")."</td><td>".$osversion."</td></tr>\n"; print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$osversion."</td></tr>\n";
print '</table>'; print '</table>';
// End of page // End of page

View File

@@ -1569,7 +1569,7 @@ function dol_print_reduction($reduction, $langs)
*/ */
function version_os($option = '') function version_os($option = '')
{ {
if ($option) $osversion = php_uname($option); if ($option == 'smr') $osversion = php_uname('s').' '.php_uname('m').' '.php_uname('r');
else $osversion = php_uname(); else $osversion = php_uname();
return $osversion; return $osversion;
} }

View File

@@ -2551,6 +2551,7 @@ if (!function_exists("llxFooter"))
print '<div id="dialogforpopup" style="display: none;"></div>'."\n"; print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
// Add code for the asynchronous anonymous first ping (for telemetry) // Add code for the asynchronous anonymous first ping (for telemetry)
// You can use &forceping=1 in parameters to force the ping.
if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha')) if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha'))
{ {
//print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->';
@@ -2560,6 +2561,8 @@ if (!function_exists("llxFooter"))
{ {
if (empty($_COOKIE['DOLINSTALLNOPING_'.md5($conf->file->instance_unique_id)])) if (empty($_COOKIE['DOLINSTALLNOPING_'.md5($conf->file->instance_unique_id)]))
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
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".'<!-- 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"; print "\n<!-- JS CODE TO ENABLE the anonymous Ontime Ping -->\n";
$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id); $hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id);
@@ -2580,7 +2583,8 @@ if (!function_exists("llxFooter"))
entity: "<?php echo (int) $conf->entity; ?>", entity: "<?php echo (int) $conf->entity; ?>",
dbtype: "<?php echo dol_escape_js($db->type); ?>", dbtype: "<?php echo dol_escape_js($db->type); ?>",
country_code: "<?php echo dol_escape_js($mysoc->country_code); ?>", country_code: "<?php echo dol_escape_js($mysoc->country_code); ?>",
php_version: "<?php echo phpversion(); ?>" php_version: "<?php echo phpversion(); ?>",
os_version: "<?php echo version_os('smr'); ?>"
}, },
success: function (data, status, xhr) { // success callback function (data contains body of response) success: function (data, status, xhr) { // success callback function (data contains body of response)
console.log("Ping ok"); console.log("Ping ok");