Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-44585

Restrict the accepted types in the gradebook import

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.5.6, 2.6.3
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide
      1. As a teacher, go to a course.
      2. Open the gradebook, click on import.
      3. Be sure to be in the CSV import type.
      4. Try to import any file who are not a text file, ex JPG, PDF, XLS etc. a warning display dialog should appear preventing you to upload this file.
      5. Try to import a CSV file. It should work. Try again with a txt file or any file with the mime type: text/plain (see function get_mimetypes_array() in filelib.php). It should work too.
      6. Go to the XML import type. Try to import a XML file. It should work.
      7. Try to import any other file type. You should see a warning display message preventing you to upload this file.
      Show
      As a teacher, go to a course. Open the gradebook, click on import. Be sure to be in the CSV import type. Try to import any file who are not a text file, ex JPG, PDF, XLS etc. a warning display dialog should appear preventing you to upload this file. Try to import a CSV file. It should work. Try again with a txt file or any file with the mime type: text/plain (see function get_mimetypes_array() in filelib.php). It should work too. Go to the XML import type. Try to import a XML file. It should work. Try to import any other file type. You should see a warning display message preventing you to upload this file.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-44585-master

      Description

      Currently its possible to upload any file types in the filepicker on any of the gradebook format.
      I think it may be more safe to restrict it only by their correct types.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              cibot CiBoT added a comment -

              Results for MDL-44585

              • Error: the repository field is empty. Nothing was checked.
              Show
              cibot CiBoT added a comment - Results for MDL-44585 Error: the repository field is empty. Nothing was checked.
              Hide
              cibot CiBoT added a comment -
              Show
              cibot CiBoT added a comment - Results for MDL-44585 Remote repository: https://github.com/StudiUM/moodle.git Remote branch MDL-44585 -master to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/2173 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/2173/artifact/work/smurf.html
              Hide
              cibot CiBoT added a comment -
              Show
              cibot CiBoT added a comment - Results for MDL-44585 Remote repository: https://github.com/StudiUM/moodle.git Remote branch MDL-44585 -master to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/2174 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/2174/artifact/work/smurf.html
              Hide
              andyjdavis Andrew Davis added a comment -

              This looks great. Backport it to 2.6 and 2.5 and submit for integration when you are ready.

              Show
              andyjdavis Andrew Davis added a comment - This looks great. Backport it to 2.6 and 2.5 and submit for integration when you are ready.
              Hide
              leblangi Gilles-Philippe Leblanc added a comment -

              Backport done. I can't put it on integration myself, please peer review it again and submit it to integration for me. Thanks !

              Show
              leblangi Gilles-Philippe Leblanc added a comment - Backport done. I can't put it on integration myself, please peer review it again and submit it to integration for me. Thanks !
              Show
              cibot CiBoT added a comment - Results for MDL-44585 Remote repository: https://github.com/StudiUM/moodle.git Remote branch MDL-44585 -moodle25 to be integrated into upstream MOODLE_25_STABLE Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/2193 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/2193/artifact/work/smurf.html Remote branch MDL-44585 -moodle26 to be integrated into upstream MOODLE_26_STABLE Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/2194 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/2194/artifact/work/smurf.html Remote branch MDL-44585 -master to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/2195 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/2195/artifact/work/smurf.html
              Hide
              cibot CiBoT added a comment -

              Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

              Show
              cibot CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Thanks Gilles-Philippe, this has been integrated now.

              Show
              samhemelryk Sam Hemelryk added a comment - Thanks Gilles-Philippe, this has been integrated now.
              Hide
              ankit_frenz Ankit Agarwal added a comment -

              Only specified types of files where accepted.

              Passing, thanks

              Show
              ankit_frenz Ankit Agarwal added a comment - Only specified types of files where accepted. Passing, thanks
              Hide
              marina Marina Glancy added a comment -

              Thanks for your awesome code, it is now part of Moodle. Don't forget to submit another issue next week (and peer review two).

              Show
              marina Marina Glancy added a comment - Thanks for your awesome code, it is now part of Moodle. Don't forget to submit another issue next week (and peer review two).

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/May/14