]> git.mjollnir.org Git - moodle.git/commitdiff
Integration of new centralised upload code with admin/uploaduser.php and fix in uploa...
authormjollnir_ <mjollnir_>
Wed, 15 Sep 2004 22:42:10 +0000 (22:42 +0000)
committermjollnir_ <mjollnir_>
Wed, 15 Sep 2004 22:42:10 +0000 (22:42 +0000)
These patches are maintained in an publicly accessible Arch repository, see: http://lists.eduforge.org/cgi-bin/archzoom.cgi/arch-eduforge@catalyst.net.nz--2004-MIRROR/moodle--eduforge--1.3.3

Index of arch patches in this commit:

arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-65
    2004-09-15 22:31:09 GMT
    Penny Leach <penny@catalyst.net.nz>
    upload class now returns false in proprocess_files if there are no files (duh), + admin/uploaduser using upload class

Full logs:

Revision: moodle--eduforge--1.3.3--patch-65
Archive: arch-eduforge@catalyst.net.nz--2004
Creator: Penny Leach <penny@catalyst.net.nz>
Date: Thu Sep 16 10:31:09 NZST 2004
Standard-date: 2004-09-15 22:31:09 GMT
Modified-files: admin/uploaduser.php lib/uploadlib.php
New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-65
Summary: upload class now returns false in proprocess_files if there are no files (duh), + admin/uploaduser using upload class
Keywords

admin/uploaduser.php
lib/uploadlib.php

index 6817b73158cc505af42c3c04ef3fb71b7a48370f..28a4a31e65cb69e9d8014650c38105e41e6ec1b9 100755 (executable)
 
 /// If a file has been uploaded, then process it
 
-    if ($filename = valid_uploaded_file($_FILES['userfile'])) {
+
+    require_once($CFG->dirroot.'/lib/uploadlib.php');
+    $um = new upload_manager('userfile',false,false,null,false,0);
+    if ($um->preprocess_files()) {
+        $filename = $um->files['userfile']['tmp_name'];
 
         //Fix mac/dos newlines
         $text = my_file_get_contents($filename);
index 676f8546328109e0656c13b59b68a76233caff4e..05fab58a9d40605095210d512ad8d3270f43bb49 100644 (file)
@@ -80,6 +80,9 @@ class upload_manager {
                 }
             }
         }
+        if (!is_array($_FILES) || count($_FILES) == 0) {
+            return false;
+        }
         $this->status = true;
         return true; // if we've got this far it means that we're recovering so we want status to be ok.
     }