Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merged fixes from stable
  • Loading branch information
moodler committed Nov 10, 2004
1 parent a35bbc9 commit 6f61241
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions files/index.php
Expand Up @@ -164,6 +164,7 @@ function set_value(txt) {
require_once($CFG->dirroot.'/lib/uploadlib.php');

if (!empty($save) and confirm_sesskey()) {
$course->maxbytes = 0; // We are ignoring course limits
$um = new upload_manager('userfile',false,false,$course,false,0);
$dir = "$basedir$wdir";
if ($um->process_file_uploads($dir)) {
Expand All @@ -172,7 +173,7 @@ function set_value(txt) {
// um will take care of error reporting.
displaydir($wdir);
} else {
$upload_max_filesize = get_max_upload_file_size($CFG->maxbytes); // Restricted by site setting
$upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
$filesize = display_size($upload_max_filesize);

$struploadafile = get_string("uploadafile");
Expand All @@ -188,7 +189,7 @@ function set_value(txt) {
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />";
upload_print_form_fragment(1,array('userfile'),null,false,null,$course->maxbytes,0,false);
upload_print_form_fragment(1,array('userfile'),null,false,null,$upload_max_filesize,0,false);
echo " </td><tr><td width=\"10\">";
echo " <input type=\"submit\" name=\"save\" value=\"$struploadthisfile\" />";
echo "</form>";
Expand Down Expand Up @@ -812,6 +813,7 @@ function displaydir ($wdir) {
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\">";
echo "<tr><td>";
echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
echo '<input type="hidden" name="choose" value="'.$choose.'">';
echo "<input type=\"hidden\" name=\"wdir\" value=\"$wdir\" /> ";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />";
$options = array (
Expand Down Expand Up @@ -846,6 +848,7 @@ function displaydir ($wdir) {
echo "</td>";
echo "<td align=\"right\">";
echo "<form action=\"index.php\" method=\"get\">";
echo ' <input type="hidden" name="choose" value="'.$choose.'">';
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />";
Expand Down

0 comments on commit 6f61241

Please sign in to comment.