summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-26 22:17:51 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-26 22:17:51 +0000
commit97a9a67584eac8c2550d158ff9203ae43973cf63 (patch)
tree0c3a4c0f8563ff9f7675eb7274746de1e5980e0f /usr
parent213657e7d9a5786f98147e1be44becfb25e1b556 (diff)
downloadpfsense-97a9a67584eac8c2550d158ff9203ae43973cf63.zip
pfsense-97a9a67584eac8c2550d158ff9203ae43973cf63.tar.gz
Fixup upload progress bar.
It now works when uploading a firmware version!
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/progress.php11
-rwxr-xr-xusr/local/www/system_firmware.php16
2 files changed, 18 insertions, 9 deletions
diff --git a/usr/local/www/progress.php b/usr/local/www/progress.php
index 8826f4a..4b54779 100755
--- a/usr/local/www/progress.php
+++ b/usr/local/www/progress.php
@@ -2,7 +2,7 @@
<?php
-$url = 'progress.php?ulfile='. $_GET["ulfile"] .'&e=1';
+$url = 'progress.php?UPLOAD_IDENTIFIER='. $_GET["UPLOAD_IDENTIFIER"] .'&e=1';
function nice_value($x) {
if ($x < 100) $x;
@@ -12,11 +12,12 @@ function nice_value($x) {
}
-$X = upload_progress_meter_get_info( $_GET["ulfile"] );
+$X = upload_progress_meter_get_info( $_GET["UPLOAD_IDENTIFIER"] );
if (!$X) {
if ( array_key_exists( "e", $_GET ) ) {
- echo ('<HTML><BODY onLoad="window.close()"> Invalid meter ID!</BODY></HTML>');
+ echo "<HTML><BODY onLoad='window.close();'>Invalid Meter ID! {$_GET["UPLOAD_IDENTIFIER"]}";
+ echo ('</BODY></HTML>');
}else{
echo ('<HTML><meta HTTP-EQUIV="Refresh" CONTENT="1; url='. $url .'"><BODY></BODY></HTML>');
}
@@ -50,11 +51,11 @@ if (!$X) {
<style type='text/css'> td {font-size: 10pt } td.uplmtr {font-size:6pt; height:12px}</style>
</HEAD>
-<BODY BGCOLOR="#C0C0C0">
+<BODY BGCOLOR="#FFFFFF">
Uploading files...
-<table border=1 WIDTH="100%" cellPadding=0 cellSpacing=0 style='BORDER-BOTTOM: 0px inset; BORDER-LEFT: 0px inset; BORDER-RIGHT: 0px inset; BORDER-TOP: 0px inset'> <tr><td>
+<table WIDTH="100%" cellPadding=0 cellSpacing=0 style='border:1px dashed #000066; BORDER-BOTTOM: 0px inset; BORDER-LEFT: 0px inset; BORDER-RIGHT: 0px inset; BORDER-TOP: 0px inset'> <tr><td>
<table border=0 WIDTH="100%" COLS="34"><tr>
<?
diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php
index 7204047..66cd6d5 100755
--- a/usr/local/www/system_firmware.php
+++ b/usr/local/www/system_firmware.php
@@ -171,8 +171,8 @@ if ($_POST && !file_exists($d_firmwarelock_path)) {
$fwinfo = "Using alternate firmware URL, cannot determine if {$config['system']['alt_firmware_url']['firmware_base_url']}{$config['system']['alt_firmware_url']['firmware_filename']} is newer than current.";
}
+/* upload progress bar id */
$id = rand() . '.' . time();
-
$mth = ini_get('upload_progress_meter.store_method');
$dir = ini_get('upload_progress_meter.file.filename_template');
@@ -186,6 +186,11 @@ $dir = ini_get('upload_progress_meter.file.filename_template');
</head>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<!--
+generated new UPLOAD_IDENTIFIER = <?=$id?>
+php-config.upload_progress_meter.store_method = <?=$mth?>
+php-config.upload_progress_meter.file.filename_template = <?=$dir?>
+-->
<?php include("fbegin.inc"); ?>
<p class="pgtitle">System: Firmware</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
@@ -208,7 +213,7 @@ print_info_box($sig_warning);
</form>
<?php else: ?>
<?php if (!file_exists($d_firmwarelock_path)): ?>
-<form action="system_firmware.php" method="post" enctype="multipart/form-data">
+<form action="system_firmware.php?UPLOAD_IDENTIFIER=<?=$id?>" method="post" enctype="multipart/form-data">
<?php if($savemsg == ""): ?>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
@@ -238,9 +243,12 @@ print_info_box($sig_warning);
<?php else: ?>
<input name="Submit" type="submit" class="formbtn" value="Disable firmware upload">
<br><br>
- <strong>Firmware image file: </strong>&nbsp;<input name="ulfile" type="file" class="formfld">
+ <strong>Firmware image file: </strong>&nbsp;
+ <input type="hidden" name="UPLOAD_IDENTIFIER" value="<?=$id?>">
+ <input name="ulfile" type="file" class="formfld">
<br><br>
- <input name="Submit" type="submit" class="formbtn" value="Upgrade firmware" onClick="window.open('progress.php?ulfile=<?=$id?>','UploadMeter','width=370,height=115', true); return true; ">
+
+ <input name="Submit" type="submit" class="formbtn" value="Upgrade firmware" onClick="window.open('progress.php?UPLOAD_IDENTIFIER=<?=$id?>','UploadMeter','width=370,height=115', true); return true; ">
<?php endif; else: ?>
<strong>You must reboot the system before you can upgrade the firmware.</strong>
<?php endif; ?>
OpenPOWER on IntegriCloud