summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/pfsense-utils.inc13
-rw-r--r--usr/local/www/system_advanced_misc.php18
2 files changed, 28 insertions, 3 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index b85ebfc..9986f52 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1770,7 +1770,10 @@ function download_file($url, $destination, $verify_ssl = true, $connect_timeout
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid')));
+ if (!isset($config['system']['host_uuid']))
+ curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid')));
+ else
+ curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
if (!empty($config['system']['proxyurl'])) {
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
@@ -1791,7 +1794,8 @@ function download_file($url, $destination, $verify_ssl = true, $connect_timeout
}
function download_file_with_progress_bar($url_file, $destination_file, $readbody = 'read_body', $connect_timeout = 5, $timeout=0) {
- global $ch, $fout, $file_size, $downloaded, $config, $first_progress_update, $g;
+ global $config, $g;
+ global $ch, $fout, $file_size, $downloaded, $config, $first_progress_update;
$file_size = 1;
$downloaded = 1;
$first_progress_update = TRUE;
@@ -1811,7 +1815,10 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody
curl_setopt($ch, CURLOPT_NOPROGRESS, '1');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
- curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid')));
+ if (!isset($config['system']['host_uuid']))
+ curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid')));
+ else
+ curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
if (!empty($config['system']['proxyurl'])) {
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php
index 3863eeb..9d11b86 100644
--- a/usr/local/www/system_advanced_misc.php
+++ b/usr/local/www/system_advanced_misc.php
@@ -69,6 +69,7 @@ $pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
$pconfig['pkg_nochecksig'] = isset($config['system']['pkg_nochecksig']);
+$pconfig['host_uuid'] = !isset($config['system']['host_uuid']);
$pconfig['powerd_ac_mode'] = "hadp";
if (!empty($config['system']['powerd_ac_mode'])) {
@@ -179,6 +180,12 @@ if ($_POST) {
unset($config['system']['pkg_nochecksig']);
}
+ if ($_POST['host_uuid'] == "yes") {
+ unset($config['system']['host_uuid']);
+ } else {
+ $config['system']['host_uuid'] = true;
+ }
+
if ($_POST['powerd_enable'] == "yes") {
$config['system']['powerd_enable'] = true;
} else {
@@ -691,6 +698,17 @@ function tmpvar_checked(obj) {
</tr>
<tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Installation Feedback"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Host UUID"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="host_uuid" type="checkbox" id="host_uuid" value="yes" <?php if ($pconfig['host_uuid']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Do NOT send HOST UUID with user agent"); ?></strong><br />
+ <?=gettext("Enable this option to not send HOST UUID to pfSense as part of User-Agent header."); ?>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
OpenPOWER on IntegriCloud