= 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); ?>
" /> " />
addClass('btn-warning'); $form = new Form($enablebtn); $section = new Form_Section('Invoke ' . $g['product_name'] .' Manual Upgrade'); $section->addInput(new Form_StaticText('Enable', 'Click the "Enable firmware upload" button below to begin.')); } else { // Upgrades are now enabled $form = new Form('Disable firmware upload'); $form->setMultipartEncoding(); $section = new Form_Section('Perform ' . $g['product_name'] .' Manual Upgrade'); if (!session_id()) $upload_id = uniqid(); else $upload_id = session_id(); $section->addInput(new Form_Input( 'UPLOAD_IDENTIFIER', '', 'hidden', $upload_id )); if(stristr($_FILES['ulfile']['name'],"nanobsd")) { $section->addInput(new Form_Input( 'isnano', '', 'hidden', 'yes' )); } if ($g['platform'] == "nanobsd") $type = "*.img.gz"; else $type = "*.tgz"; $filepicker = new Form_Input( 'ulfile', 'File to upload (' . $type . ')', 'file', '' ); $section->addInput($filepicker)->setHelp('Choose the file you wish to upload'); if ($g['hidebackupbeforeupgrade'] === false) { $section->addInput(new Form_Checkbox( 'backupbeforeupgrade', Backup, 'Perform a full backup prior to upgrade', false )); } $section->addInput(new Form_Button( 'Submit', 'Upgrade firmware' ))->addClass('btn-danger btn-sm')->setHelp('Click the "Upgrade firmware" button above to start the upgrade process'); } $form->add($section); print($form); } } else { print_info_box('' . gettext("You must reboot the system before you can upgrade the firmware.") . ''); } if (is_subsystem_dirty('firmware') && !is_subsystem_dirty('firmwarelock')) { print_info_box('' . gettext("DO NOT ") . '' . gettext('abort the firmware upgrade once it ' . 'has started. The firewall will reboot automatically after ' . 'storing the new firmware. The configuration will be maintained.')); } } include("foot.inc"); ?>