From 144420334464acd2d12f06bc1693fa3f9aa5086f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 4 Jul 2009 15:59:57 -0400 Subject: Pass along php error number if it happens. New in 5.3. Lovely. --- usr/local/www/system_firmware.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index c78a128..8b7a95c 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -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}."; } } } -- cgit v1.1