Pārlūkot izejas kodu

Fix do not ping name of server

Laurent Destailleur 5 gadi atpakaļ
vecāks
revīzija
c22fea52e5

+ 2 - 2
htdocs/admin/system/os.php

@@ -42,11 +42,11 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$lan
 print "\n";
 
 // 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
 $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>';
 
 // End of page

+ 1 - 1
htdocs/core/lib/functions2.lib.php

@@ -1569,7 +1569,7 @@ function dol_print_reduction($reduction, $langs)
  */
 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();
     return $osversion;
 }

+ 5 - 1
htdocs/main.inc.php

@@ -2551,6 +2551,7 @@ if (!function_exists("llxFooter"))
 		print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
 
 		// 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'))
 		{
 			//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)]))
 				{
+					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<!-- JS CODE TO ENABLE the anonymous Ontime Ping -->\n";
 					$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id);
@@ -2580,7 +2583,8 @@ if (!function_exists("llxFooter"))
 			    					  entity: "<?php echo (int) $conf->entity; ?>",
 			    					  dbtype: "<?php echo dol_escape_js($db->type); ?>",
 			    					  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)
 		      					    	console.log("Ping ok");