Pass along php error number if it happens. New in 5.3. Lovely.

This commit is contained in:
Scott Ullrich 2009-07-04 15:59:57 -04:00
parent b6b87fef6e
commit 1444203344

View File

@ -97,6 +97,8 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
conf_mount_ro();
clear_subsystem_dirty('firmware');
} else if ($mode == "upgrade") {
if($_FILES['ulfile']['error'])
$errortext = "Error ({$_FILES['ulfile']['error']})";
if (is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
/* verify firmware image(s) */
if (!stristr($_FILES['ulfile']['name'], $g['platform']) && !$_POST['sig_override'])
@ -133,7 +135,7 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
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');
mark_subsystem_dirty('firmwarelock');
$savemsg = "The firmware is now being updated. The firewall will reboot automatically.";
if(stristr($_FILES['ulfile']['name'],"nanobsd"))
mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz");
@ -142,7 +144,7 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
else
mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['upload_path']}/firmware.tgz");
} else {
$savemsg = "Firmware image missing or other error, please try again.";
$savemsg = "Firmware image missing or other error, please try again {$errortext}.";
}
}
}