Project

General

Profile

« Previous | Next » 

Revision 48600bc6

Added by Renato Botelho about 8 years ago

Send uniqueid instead of UUID on user-agent

View differences:

src/etc/inc/pfsense-utils.inc
1974 1974
	curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
1975 1975
	curl_setopt($ch, CURLOPT_HEADER, false);
1976 1976
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
1977
	if (!isset($config['system']['do_not_send_host_uuid'])) {
1978
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . get_single_sysctl('kern.hostuuid'));
1977
	if (!isset($config['system']['do_not_send_uniqueid'])) {
1978
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . system_get_uniqueid());
1979 1979
	} else {
1980 1980
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']);
1981 1981
	}
......
2029 2029
	curl_setopt($ch, CURLOPT_NOPROGRESS, '1');
2030 2030
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout);
2031 2031
	curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
2032
	if (!isset($config['system']['do_not_send_host_uuid'])) {
2033
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . get_single_sysctl('kern.hostuuid'));
2032
	if (!isset($config['system']['do_not_send_uniqueid'])) {
2033
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . system_get_uniqueid());
2034 2034
	} else {
2035 2035
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']);
2036 2036
	}
src/etc/inc/pkg-utils.inc
110 110
	global $config, $g;
111 111

  
112 112
	$user_agent = $g['product_name'] . '/' . $g['product_version'];
113
	if (!isset($config['system']['do_not_send_host_uuid'])) {
114
		$user_agent .= ' : ' . get_single_sysctl('kern.hostuuid');
113
	if (!isset($config['system']['do_not_send_uniqueid'])) {
114
		$user_agent .= ' : ' . system_get_uniqueid();
115 115
	}
116 116

  
117 117
	$pkg_env_vars = array(
src/usr/local/www/crash_reporter.php
61 61
require_once("guiconfig.inc");
62 62
require_once("functions.inc");
63 63
require_once("captiveportal.inc");
64
require_once("system.inc");
64 65

  
65 66
define("FILE_SIZE", 450000);
66 67

  
67 68
function upload_crash_report($files) {
68
	global $g;
69
	global $g, $config;
70

  
69 71
	$post = array();
70 72
	$counter = 0;
71 73
	foreach ($files as $file) {
......
77 79
	curl_setopt($ch, CURLOPT_VERBOSE, 0);
78 80
	curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);
79 81
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
80
	curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']);
82
	if (!isset($config['system']['do_not_send_uniqueid'])) {
83
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . system_get_uniqueid());
84
	} else {
85
		curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']);
86
	}
81 87
	curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']);
82 88
	curl_setopt($ch, CURLOPT_POST, true);
83 89
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
src/usr/local/www/system_advanced_misc.php
87 87
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
88 88
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
89 89
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
90
$pconfig['do_not_send_host_uuid'] = isset($config['system']['do_not_send_host_uuid']);
90
$pconfig['do_not_send_uniqueid'] = isset($config['system']['do_not_send_uniqueid']);
91 91

  
92 92
$pconfig['powerd_ac_mode'] = "hadp";
93 93
if (!empty($config['system']['powerd_ac_mode'])) {
......
215 215
			unset($config['system']['pkg_nochecksig']);
216 216
		}
217 217

  
218
		if ($_POST['do_not_send_host_uuid'] == "yes") {
219
			$config['system']['do_not_send_host_uuid'] = true;
218
		if ($_POST['do_not_send_uniqueid'] == "yes") {
219
			$config['system']['do_not_send_uniqueid'] = true;
220 220
		} else {
221
			unset($config['system']['do_not_send_host_uuid']);
221
			unset($config['system']['do_not_send_uniqueid']);
222 222
		}
223 223

  
224 224
		if ($_POST['powerd_enable'] == "yes") {
......
597 597
$section = new Form_Section('Installation Feedback');
598 598

  
599 599
$section->addInput(new Form_Checkbox(
600
	'do_not_send_host_uuid',
601
	'Host UUID',
602
	'Do NOT send HOST UUID with user agent',
603
	$pconfig['do_not_send_host_uuid']
604
))->setHelp('Enable this option to not send HOST UUID to pfSense as part of User-Agent header.');
600
	'do_not_send_uniqueid',
601
	'Netgate Device ID',
602
	'Do NOT send Netgate Device ID with user agent',
603
	$pconfig['do_not_send_uniqueid']
604
))->setHelp('Enable this option to not send Netgate Device ID to pfSense as part of User-Agent header.');
605 605

  
606 606
$form->add($section);
607 607

  

Also available in: Unified diff