Commit 93e4773f authored by Franco Fichtner's avatar Franco Fichtner

firmware: for now, push crypto settings to "System: Settings: General"

parent de984e2f
...@@ -787,31 +787,25 @@ EOD; ...@@ -787,31 +787,25 @@ EOD;
return $retval; return $retval;
} }
function system_webgui_start() function system_firmware_configure()
{ {
global $config, $g; global $config;
chdir('/usr/local/www'); $pkg_mirror = 'http://pkg.opnsense.org';
$pkg_flavour = 'latest';
/* defaults */ if (!file_exists('/usr/local/etc/pkg/repos/OPNsense.conf.sample')) {
$portarg = "80"; return;
$crt = ""; }
$key = "";
$ca = "";
/* XXX migrate this to a more appropriate place */
if (file_exists('/usr/local/etc/pkg/repos/OPNsense.conf.sample')) {
$pkg_flavour = 'latest';
if (isset($config['system']['firmware']['flavour'])) { if (isset($config['system']['firmware']['flavour'])) {
$pkg_flavour = $config['system']['firmware']['flavour']; $pkg_flavour = $config['system']['firmware']['flavour'];
} }
$pkg_mirror = 'http://pkg.opnsense.org';
if (isset($config['system']['firmware']['mirror'])) { if (isset($config['system']['firmware']['mirror'])) {
$pkg_mirror = $config['system']['firmware']['mirror']; $pkg_mirror = $config['system']['firmware']['mirror'];
} }
/* upgrade pkg(8) mirror info */
$pkg_sample = file_get_contents('/usr/local/etc/pkg/repos/OPNsense.conf.sample'); $pkg_sample = file_get_contents('/usr/local/etc/pkg/repos/OPNsense.conf.sample');
$pkg_sample = explode(PHP_EOL, $pkg_sample); $pkg_sample = explode(PHP_EOL, $pkg_sample);
$pkg_config = ''; $pkg_config = '';
...@@ -828,7 +822,20 @@ function system_webgui_start() ...@@ -828,7 +822,20 @@ function system_webgui_start()
$pkg_config .= $pkg_line . PHP_EOL; $pkg_config .= $pkg_line . PHP_EOL;
} }
file_put_contents('/usr/local/etc/pkg/repos/OPNsense.conf', $pkg_config); file_put_contents('/usr/local/etc/pkg/repos/OPNsense.conf', $pkg_config);
}
}
function system_webgui_start()
{
global $config;
chdir('/usr/local/www');
/* defaults */
$portarg = "80";
$crt = "";
$key = "";
$ca = "";
/* non-standard port? */ /* non-standard port? */
if (isset($config['system']['webgui']['port']) && $config['system']['webgui']['port'] <> "") if (isset($config['system']['webgui']['port']) && $config['system']['webgui']['port'] <> "")
......
...@@ -45,6 +45,18 @@ function get_locale_list() ...@@ -45,6 +45,18 @@ function get_locale_list()
return $locales; return $locales;
} }
function get_flavour_list()
{
$flavours = array();
$flavours['libressl'] = 'LibreSSL';
$flavours['latest'] = 'OpenSSL';
asort($flavours);
return $flavours;
}
$pconfig['hostname'] = $config['system']['hostname']; $pconfig['hostname'] = $config['system']['hostname'];
$pconfig['domain'] = $config['system']['domain']; $pconfig['domain'] = $config['system']['domain'];
list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver']; list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver'];
...@@ -62,6 +74,9 @@ $pconfig['timeupdateinterval'] = $config['system']['time-update-interval']; ...@@ -62,6 +74,9 @@ $pconfig['timeupdateinterval'] = $config['system']['time-update-interval'];
$pconfig['timeservers'] = $config['system']['timeservers']; $pconfig['timeservers'] = $config['system']['timeservers'];
$pconfig['theme'] = $config['system']['theme']; $pconfig['theme'] = $config['system']['theme'];
$pconfig['language'] = $config['system']['language']; $pconfig['language'] = $config['system']['language'];
if ($isset($config['system']['firmware']['flavour'])) {
$pconfig['firmware_flavour'] = $config['system']['firmware']['flavour'];
}
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']); $pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
...@@ -173,11 +188,23 @@ if ($_POST) { ...@@ -173,11 +188,23 @@ if ($_POST) {
update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers'])); update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']); update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
if($_POST['language'] && $_POST['language'] != $config['system']['language']) { if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
$config['system']['language'] = $_POST['language']; $config['system']['language'] = $_POST['language'];
set_language($config['system']['language']); set_language($config['system']['language']);
} }
if (!isset($config['system']['firmware'])) {
$config['system']['firmware'] = array();
}
if ($_POST['firmware_flavour']) {
$config['system']['firmware']['flavour'] = $_POST['firmware_flavour'];
} else {
if (isset($config['system']['firmware']['flavour'])) {
unset($config['system']['firmware']['flavour']);
}
}
system_firmware_configure();
update_if_changed("System Theme", $config['theme'], $_POST['theme']); update_if_changed("System Theme", $config['theme'], $_POST['theme']);
/* XXX - billm: these still need updating after figuring out how to check if they actually changed */ /* XXX - billm: these still need updating after figuring out how to check if they actually changed */
...@@ -460,11 +487,30 @@ include("head.inc"); ...@@ -460,11 +487,30 @@ include("head.inc");
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?php echo gettext("Language");?></td> <td width="22%" valign="top" class="vncell"><?=gettext("Cryptography");?></td>
<td width="78%" class="vtable">
<select name="firmware_flavour" class="selectpicker" data-style="btn-default" data-width="auto">
<?php
foreach(get_flavour_list() as $fcode => $fdesc) {
$selected = ' selected="selected"';
if ($fcode != $pconfig['firmware_flavour']) {
$selected = '';
}
echo "<option value=\"{$fcode}\"{$selected}>{$fdesc}</option>";
}
?>
</select>
<strong>
<?=gettext("Choose the cryptography library to be used by the system."); ?>
</strong>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Language");?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<select name="language" class="selectpicker" data-style="btn-default" data-width="auto"> <select name="language" class="selectpicker" data-style="btn-default" data-width="auto">
<?php <?php
foreach(get_locale_list() as $lcode => $ldesc) { foreach (get_locale_list() as $lcode => $ldesc) {
$selected = ' selected="selected"'; $selected = ' selected="selected"';
if($lcode != $pconfig['language']) if($lcode != $pconfig['language'])
$selected = ''; $selected = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment