From bfa580b522a66e3755e5f56fd51aa3b302f41170 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jun 2015 09:36:00 +0200 Subject: [PATCH] firmware: almost remove old pages Discussed with: ad@ --- src/www/system_firmware_check.php | 295 +-------------------------- src/www/system_firmware_settings.php | 117 +---------- src/www/system_firmware_tabs.inc | 37 ---- 3 files changed, 4 insertions(+), 445 deletions(-) delete mode 100644 src/www/system_firmware_tabs.inc diff --git a/src/www/system_firmware_check.php b/src/www/system_firmware_check.php index 97c5466a2..656eb84f7 100644 --- a/src/www/system_firmware_check.php +++ b/src/www/system_firmware_check.php @@ -1,295 +1,4 @@ - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -require_once("guiconfig.inc"); -require_once("pfsense-utils.inc"); -require_once("script/load_phalcon.php"); - -/* Setup variables for upgrade procedure */ -$file_pkg_status="/tmp/pkg_status.json"; -$file_upgrade_progress="/tmp/pkg_upgrade.progress"; -$pkg_status = array(); -$package="none"; - -/* Setup Shell variables */ -$shell_output = array(); -$shell = new OPNsense\Core\Shell(); - -if (file_exists($file_pkg_status)) { - $json = file_get_contents($file_pkg_status); - $pkg_status = json_decode($json, true); - if ($pkg_status["updates"] == "1" && $pkg_status["upgrade_packages"][0]["name"] == "pkg") { - $package="pkg"; - } else { - $package="all"; - } -} - -if ($_POST['action'] == 'pkg_upgrade') { - // execute shell command and collect (only valid) info into named array - $cmd = '/usr/sbin/daemon -f /usr/local/opnsense/scripts/pkg_upgrade.sh ' . escapeshellarg($package); - $shell->exec($cmd, false, $shell_output); - exit; -} - -if ($_POST['action'] == 'pkg_update') { - // execute shell command and collect (only valid) info into named array - $shell->exec('/usr/local/opnsense/scripts/pkg_updatecheck.sh', false, $shell_output); -} - -if ($_POST['action'] == 'update_status') { - if (file_exists($file_upgrade_progress)) { - $content = file_get_contents($file_upgrade_progress); - echo $content; - } - exit; -} - -if ($_REQUEST['getupdatestatus']) { - if (file_exists($file_pkg_status)) { - if ($pkg_status["connection"]=="error") { - echo "".gettext("Connection Error")."
".gettext("Click to retry now").""; - } elseif ($pkg_status["repository"]=="error") { - echo "".gettext("Repository Problem")."
".gettext("Click to retry now").""; - } elseif ($pkg_status["updates"]=="0") { - echo "".gettext("At")." ".$pkg_status["last_check"]."".gettext(" no updates found.")."
".gettext("Click to check now").""; - } elseif ($pkg_status["updates"] == "1" && $pkg_status["upgrade_packages"][0]["name"] == "pkg") { - echo "".gettext("There is a mandatory update for the package manager."). - "(When last checked at: ".$pkg_status["last_check"]." )
". - "".gettext("Upgrade pkg and recheck, there maybe other updates available."). - "
".gettext("Upgrade Now"). - " ".gettext("Re-Check Now").""; - } else { - echo "".gettext("A total of ").$pkg_status["updates"].gettext(" update(s) are available.")."(When last checked at: ".$pkg_status["last_check"]." )"."
".gettext("Upgrade Now")." ".gettext("Re-Check Now").""; - } - } else { - echo "".gettext("Current status is unknown")."
".gettext("Click to check now").""; - } - exit; -} - -$pgtitle=array(gettext("System"), gettext("Firmware"), gettext("Auto Update")); -include("head.inc"); - -?> - - - - - - -
-
- -
-
- - - -
- -
- -
- - - - - - - - - - - - - - - - '; - echo ''; - echo ''; - echo ''; - echo ''; - foreach ($pkg_status["upgrade_packages"] as $upgrade_new) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - } - foreach ($pkg_status["new_packages"] as $upgrade_new) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - foreach ($pkg_status["reinstall_packages"] as $upgrade_new) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - echo '
Current Firmware Status
-
-
- -
- -
-
Available Upgrades
-
- '; - echo '
Package NameCurrent VersionNew Version
'; - echo ''.$upgrade_new["name"].'
'; - echo '
'; - echo ''.$upgrade_new["current_version"].'
'; - echo '
'; - echo ''.$upgrade_new["new_version"].'
'; - echo '
'; - echo ''.$upgrade_new["name"].'
'; - echo '
'; - echo 'NEW
'; - echo '
'; - echo ''.$upgrade_new["version"].'
'; - echo '
'; - echo ''.$upgrade_new["name"].'
'; - echo '
'; - echo ''.$upgrade_new["version"].'
'; - echo '
'; - echo 'REINSTALL
'; - echo '
'; - ?> -
- - - - - -
- - - -
-
- - - - - - - - - - Copyright (C) 2005 Colin Smith - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -require_once('guiconfig.inc'); - -if ($_POST) { - if (!$input_errors) { - if ($_POST['disablecheck'] == "yes") { - $config['system']['firmware']['disablecheck'] = true; - } else { - unset($config['system']['firmware']['disablecheck']); - } - - write_config(); - } -} - -$curcfg = $config['system']['firmware']; - -$pgtitle = array(gettext("System"),gettext("Firmware"),gettext("Settings")); -include("head.inc"); - -?> - - - - - - - -
-
- -
- -
- - - -
- -
- - - - - - - - - - - - - - -
- /> -
- -
- - - - - - -
  - " /> -
- -
- -
-
-
-
-
- - -