summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-11-18 11:56:29 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-11-18 11:56:29 -0500
commit4d4eefabb70a4d895e564ff0a57721b11d59dadc (patch)
tree4dcc489be59a6c7535eaa263d43b9a3d040e9be5
parentd8ee2a3d08c94f3e9a1b1438100609e8990a83e2 (diff)
downloadpfsense-4d4eefabb70a4d895e564ff0a57721b11d59dadc.zip
pfsense-4d4eefabb70a4d895e564ff0a57721b11d59dadc.tar.gz
System update settings UI implemented
-rw-r--r--src/etc/inc/priv.defs.inc10
-rw-r--r--src/etc/pfSense.obsoletedfiles1
-rw-r--r--src/usr/local/www/guiconfig.inc2
-rw-r--r--src/usr/local/www/help.php2
-rw-r--r--src/usr/local/www/pkg_mgr_install.php13
-rw-r--r--src/usr/local/www/system_update_settings.php (renamed from src/usr/local/www/system_firmware_settings.php)82
6 files changed, 38 insertions, 72 deletions
diff --git a/src/etc/inc/priv.defs.inc b/src/etc/inc/priv.defs.inc
index 4398cfd..69343bd 100644
--- a/src/etc/inc/priv.defs.inc
+++ b/src/etc/inc/priv.defs.inc
@@ -1146,11 +1146,11 @@ $priv_list['page-system-crlmanager']['descr'] = gettext("Allow access to the 'Sy
$priv_list['page-system-crlmanager']['match'] = array();
$priv_list['page-system-crlmanager']['match'][] = "system_crlmanager.php*";
-$priv_list['page-system-firmware-settings'] = array();
-$priv_list['page-system-firmware-settings']['name'] = gettext("WebCfg - System: Firmware: Settings page");
-$priv_list['page-system-firmware-settings']['descr'] = gettext("Allow access to the 'System: Firmware: Settings' page.");
-$priv_list['page-system-firmware-settings']['match'] = array();
-$priv_list['page-system-firmware-settings']['match'][] = "system_firmware_settings.php*";
+$priv_list['page-system-update-settings'] = array();
+$priv_list['page-system-update-settings']['name'] = gettext("WebCfg - System: Update: Settings page");
+$priv_list['page-system-update-settings']['descr'] = gettext("Allow access to the 'System: Update: Settings' page.");
+$priv_list['page-system-update-settings']['match'] = array();
+$priv_list['page-system-update-settings']['match'][] = "system_update_settings.php*";
$priv_list['page-system-gatewaygroups'] = array();
$priv_list['page-system-gatewaygroups']['name'] = gettext("WebCfg - System: Gateway Groups page");
diff --git a/src/etc/pfSense.obsoletedfiles b/src/etc/pfSense.obsoletedfiles
index e336e86..6c00088 100644
--- a/src/etc/pfSense.obsoletedfiles
+++ b/src/etc/pfSense.obsoletedfiles
@@ -838,6 +838,7 @@
/usr/local/www/system_firmware.php
/usr/local/www/system_firmware_auto.php
/usr/local/www/system_firmware_check.php
+/usr/local/www/system_firmware_settings.php
/usr/local/www/system_firmware_restorefullbackup.php
/usr/local/www/system_usermanager_addcert.php
/usr/local/www/themes
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc
index 3d0e2fc..0a01ba5 100644
--- a/src/usr/local/www/guiconfig.inc
+++ b/src/usr/local/www/guiconfig.inc
@@ -111,7 +111,7 @@ $mandfldhtmlspc = ""; /* same as above, but with spacing */
if (!$ignorefirmwarelock) {
if (is_subsystem_dirty('firmwarelock')) {
if (!$d_isfwfile) {
- header("Location: system_firmware.php");
+ header("Location: system_update.php");
exit;
} else {
return;
diff --git a/src/usr/local/www/help.php b/src/usr/local/www/help.php
index cddb930..ca632c4 100644
--- a/src/usr/local/www/help.php
+++ b/src/usr/local/www/help.php
@@ -175,7 +175,7 @@ $helppages = array(
'system_advanced_network.php' => 'https://doc.pfsense.org/index.php/Advanced_Setup#Firewall.2FNAT',
'system_advanced_notifications.php' => 'https://doc.pfsense.org/index.php/Advanced_Setup#Notifications',
'system_advanced_sysctl.php' => 'https://doc.pfsense.org/index.php/Advanced_Setup#System_Tunables',
- 'system_firmware_settings.php' => 'https://doc.pfsense.org/index.php/Firmware_Updates',
+ 'system_update_settings.php' => 'https://doc.pfsense.org/index.php/Firmware_Updates',
'system_gateway_groups.php' => 'https://doc.pfsense.org/index.php/Gateway_Settings',
'system_gateway_groups_edit.php' => 'https://doc.pfsense.org/index.php/Gateway_Settings',
'system_gateways.php' => 'https://doc.pfsense.org/index.php/Gateway_Settings',
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index a0373b0..6917c02 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -244,6 +244,11 @@ if ($_POST) {
}
}
+if($_GET && $_GET['id'] == "firmware") {
+ $firmwareupdate = true;
+ $firmwareversion = get_system_pkg_version();
+}
+
$pgtitle = array(gettext("System"),gettext("Package Manager"), $headline);
include("head.inc");
@@ -251,13 +256,13 @@ $tab_array = array();
$tab_array[] = array(gettext("Available packages"), false, "pkg_mgr.php");
$tab_array[] = array(gettext("Installed packages"), false, "pkg_mgr_installed.php");
$tab_array[] = array(gettext("Package Installer"), true, "");
-display_top_tabs($tab_array);
-if($_GET && $_GET['id'] == "firmware") {
- $firmwareupdate = true;
- $firmwareversion = get_system_pkg_version();
+if($firmwareupdate) {
+ $tab_array[] = array(gettext("Updater Settings"), false, "system_update_settings.php");
}
+display_top_tabs($tab_array);
+
if ($input_errors)
print_input_errors($input_errors);
diff --git a/src/usr/local/www/system_firmware_settings.php b/src/usr/local/www/system_update_settings.php
index 5e62809..e09bd61 100644
--- a/src/usr/local/www/system_firmware_settings.php
+++ b/src/usr/local/www/system_update_settings.php
@@ -1,6 +1,6 @@
<?php
/*
- system_firmware_settings.php
+ system_update_settings.php
*/
/* ====================================================================
* Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved.
@@ -62,10 +62,11 @@
##|*IDENT=page-system-firmware-settings
##|*NAME=System: Firmware: Settings page
##|*DESCR=Allow access to the 'System: Firmware: Settings' page.
-##|*MATCH=system_firmware_settings.php*
+##|*MATCH=system_update_settings.php*
##|-PRIV
require("guiconfig.inc");
+require("pkg-utils.inc");
if ($_POST) {
unset($input_errors);
@@ -76,19 +77,13 @@ if ($_POST) {
}
if (!$input_errors) {
- if ($_POST['alturlenable'] == "yes") {
- $config['system']['firmware']['alturl']['enable'] = true;
- $config['system']['firmware']['alturl']['firmwareurl'] = $_POST['firmwareurl'];
- } else {
- unset($config['system']['firmware']['alturl']['enable']);
- unset($config['system']['firmware']['alturl']['firmwareurl']);
- unset($config['system']['firmware']['alturl']);
- unset($config['system']['firmware']);
- }
- if ($_POST['allowinvalidsig'] == "yes") {
- $config['system']['firmware']['allowinvalidsig'] = true;
- } else {
- unset($config['system']['firmware']['allowinvalidsig']);
+ // Set the firmware branch, but only if we are not using it already
+ if ($_POST['fwbranch']) {
+ if(($_POST['fwbranch'] == "development") && is_pkg_installed($g['product_name'] . "-repo")) {
+ pkg_switch_repo(true);
+ } else if(($_POST['fwbranch'] == "stable") && is_pkg_installed($g['product_name'] . "-repo-devel")) {
+ pkg_switch_repo(false);
+ }
}
if ($_POST['disablecheck'] == "yes") {
@@ -129,7 +124,8 @@ if ($savemsg)
print_info_box($savemsg, 'success');
$tab_array = array();
-$tab_array[] = array(gettext("Updater Settings"), true, "system_firmware_settings.php");
+$tab_array[] = array(gettext("Updater Settings"), true, "system_update_settings.php");
+$tab_array[] = array(gettext("Upgrade"), false, "pkg_mgr_install.php?id=firmware");
display_top_tabs($tab_array);
require_once('classes/Form.class.php');
@@ -138,61 +134,25 @@ $form = new Form();
$section = new Form_Section('Firmware Branch');
-if(is_array($preset_urls_split)) {
- $urllist = array();
-
- foreach($preset_urls_split as $pus) {
- $pus_text = explode("\t", $pus);
- if (empty($pus_text[0]))
- continue;
- if (stristr($pus_text[0], php_uname("m")) !== false) {
- $yourarch = " (Current architecture)";
- $choice = $pus_text[1];
- } else {
- $yourarch = "";
- }
-
- $urllist[$pus_text[1]] = $pus_text[0] . $yourarch;
- }
-
- $section->addInput(new Form_Select(
- 'preseturls',
- 'Default Auto Update URLs',
- $choice,
- $urllist
- ))->setHelp('Entries denoted by "Current architecture" match the architecture of your current installation, ' .
- 'such as %s. Changing architectures during an upgrade is not recommended, and may require a manual reboot after the update completes.', [php_uname("m")]);
-
- $form->add($section);
-}
-
-$section = new Form_Section('Firmware Auto Update URL');
-
-$section->addInput(new Form_Checkbox(
- 'alturlenable',
- 'Unofficial',
- 'Allow the use of an "unofficial" server for firmware upgrades',
- isset($curcfg['alturl']['enable'])
- ));
-
-$section->addInput(new Form_Input(
- 'firmwareurl',
- 'Base URL',
- 'text'
- ))->setHelp('This is where %s will check for newer firmware versions when the <a href="system_firmware_check.php">' .
- 'System: Firmware: Auto Update</a> page is viewed', [$g['product_name']]);
+$section->addInput(new Form_Select(
+ fwbranch,
+ 'Branch',
+ (is_pkg_installed($g['product_name'] . "-repo")) ? "stable":"development",
+ ["stable" => "Stable", "development" => "Development"]
+))->setHelp('Please select the stable, or the development branch from which to update the system firmware. ' . ' <br />' .
+ 'Use of the development version is at your own risk!');
$form->add($section);
$section = new Form_Section('Updates');
-
+/*
$section->addInput(new Form_Checkbox(
'allowinvalidsig',
'Unsigned images',
'Allow auto-update firmware images with a missing or invalid digital signature to be used',
isset($curcfg['allowinvalidsig'])
));
-
+*/
$section->addInput(new Form_Checkbox(
'disablecheck',
'Dashboard check',
OpenPOWER on IntegriCloud