Moodle
  1. Moodle
  2. MDL-24406

Upload users doesn't validate email

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Using the "Upload user", that is admin/uploaduser.php , was noted that it doesn't validates the email address. I've uploading several users with not even an "@" in the email field.
      Don't know what is the best place to put the validation.

      Credits to Antônio Carlos Mariani, that found the bug.

        Gliffy Diagrams

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this issue.

          We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

          If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

          Michael d;

          lqjjLKA0p6

          Show
          Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
          Hide
          Daniel Neis added a comment -

          Hello, Michael

          i looked at the code and it seems to be validating now:

          • The tool is now located at admin/tool/uploaduser (the code to upload is on index.php)
          • On user creation, it testes for empty emails on line 623 and for invalid on 639
          • On user update, it checks for invalid emails on line 510, but first it does a "record_exists" query with the potential invalid email. Is this the expected behaviour or we should first validate the email and then search on database ?

          HTH,
          Daniel

          Show
          Daniel Neis added a comment - Hello, Michael i looked at the code and it seems to be validating now: The tool is now located at admin/tool/uploaduser (the code to upload is on index.php) On user creation, it testes for empty emails on line 623 and for invalid on 639 On user update, it checks for invalid emails on line 510, but first it does a "record_exists" query with the potential invalid email. Is this the expected behaviour or we should first validate the email and then search on database ? HTH, Daniel
          Hide
          Petr Skoda added a comment -

          Already fixed in 2.x, thanks for the report.

          Show
          Petr Skoda added a comment - Already fixed in 2.x, thanks for the report.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: