= 3)) {
$sig_warning = gettext("There has been an error verifying the signature on this image.");
}
if (!verify_gzip_file("{$g['upload_path']}/firmware.tgz")) {
$input_errors[] = gettext("The image file is corrupt.");
unlink("{$g['upload_path']}/firmware.tgz");
}
}
}
run_plugins("/usr/local/pkg/firmware_upgrade");
/* Check for input errors, firmware locks, warnings, then check for firmware if sig_override is set */
if (!$input_errors && !is_subsystem_dirty('firmwarelock') && (!$sig_warning || $_POST['sig_override'])) {
if (file_exists("{$g['upload_path']}/firmware.tgz")) {
/* fire up the update script in the background */
mark_subsystem_dirty('firmwarelock');
$savemsg = gettext("The firmware is now being updated. The firewall will reboot automatically.");
if (stristr($_FILES['ulfile']['name'], "nanobsd") or $_POST['isnano'] == "yes") {
mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz");
} else {
if ($g['platform'] == "nanobsd") {
$whichone = "pfSenseNanoBSDupgrade";
} else {
$whichone = "pfSenseupgrade";
}
mwexec_bg("/etc/rc.firmware {$whichone} {$g['upload_path']}/firmware.tgz");
unset($whichone);
}
} else {
$savemsg = sprintf(gettext("Firmware image missing or other error, please try again %s."), $errortext);
}
}
}
}
}
$pgtitle = array(gettext("System"), gettext("Firmware"));
include("head.inc");
if ($input_errors)
print_input_errors($input_errors);
if ($savemsg)
print_info_box($savemsg);
if ($fwinfo != "")
print_info_box($fwinfo);
$tab_array = array();
$tab_array[] = array(gettext("Manual Update"), true, "system_firmware.php");
$tab_array[] = array(gettext("Auto Update"), false, "system_firmware_check.php");
$tab_array[] = array(gettext("Updater Settings"), false, "system_firmware_settings.php");
if($g['hidedownloadbackup'] == false)
$tab_array[] = array(gettext("Restore Full Backup"), false, "system_firmware_restorefullbackup.php");
display_top_tabs($tab_array);
// For a simple yes/no we can use an HTML form
if ($sig_warning && !$input_errors) {
$sig_warning = gettext("The image you uploaded " .
"is not an official/supported image and may lead to unexpected behavior or security " .
"compromises. Only install images that come from sources that you trust, and make sure ".
"that the image has not been tampered with.") . "
".
gettext("Do you want to install this image anyway (on your own risk)?");
print_info_box($sig_warning);
?>