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

Config setting to control allowing duplicate email addresses

XMLWordPrintable

    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • Hide

      Install the patch and switch the new allowaccountssameemail setting on. (May need a version bump)

      Test 1: CSV upload operates as normal

      1. Log in as an admin
      2. Go to Site Administration -> Users -> Accounts -> Upload users
      3. Upload a CSV file containing users with the same email address and confirm that you see the "Prevent email address duplicates" option
      4. Ensure that this option works as expected

      Test 2: Can save accounts with duplicate emails

      1. Log in as an admin
      2. Create a user account with email test2@example.com
      3. Create another user with the same email address
      4. Confirm that you are allowed to save this

      For the next two tests, set the allowaccountssameemail setting to off.

      Test 3: CSV upload doesn't give option

      1. Log in as admin
      2. Go to Site Administration -> Users -> Accounts -> Upload users
      3. Upload a CSV file containing users with the same email address and confirm that you don't see the "Prevent email address duplicates" option
      4. Submit the form and confirm that the accounts with multiple email addresses are not created

      Test 4: Repeat test 3 but use developer tools to change the value of the hidden uunoemailduplicates field to 0. Confirm that the accounts with duplicate email addresses are still not created.

      Test 5: Can't save accounts with duplicate emails

      1. Log in as admin
      2. Create a user account with email test5@example.com
      3. Try to create another user with the same email address
      4. Confirm that you are not allowed to save this
      Show
      Install the patch and switch the new allowaccountssameemail setting on. (May need a version bump) Test 1: CSV upload operates as normal Log in as an admin Go to Site Administration -> Users -> Accounts -> Upload users Upload a CSV file containing users with the same email address and confirm that you see the "Prevent email address duplicates" option Ensure that this option works as expected Test 2: Can save accounts with duplicate emails Log in as an admin Create a user account with email test2@example.com Create another user with the same email address Confirm that you are allowed to save this For the next two tests, set the allowaccountssameemail setting to off. Test 3: CSV upload doesn't give option Log in as admin Go to Site Administration -> Users -> Accounts -> Upload users Upload a CSV file containing users with the same email address and confirm that you don't see the "Prevent email address duplicates" option Submit the form and confirm that the accounts with multiple email addresses are not created Test 4: Repeat test 3 but use developer tools to change the value of the hidden uunoemailduplicates field to 0. Confirm that the accounts with duplicate email addresses are still not created. Test 5: Can't save accounts with duplicate emails Log in as admin Create a user account with email test5@example.com Try to create another user with the same email address Confirm that you are not allowed to save this

      Moodle is inconsistent in allowing duplicate email addresses in some places (CSV upload of users) and not in others. If this is going to be supported at all, it should be consistent.

      A particular scenario that is a bit crazy is this:

      • A system administrator uploads a CSV of user accounts, all of which have the same email address.
      • One of the users notices that his name has been misspelled and asks the system administrator to change it.
      • The system administrator tries to edit the user's name in his profile, but isn't allowed to save as the form validation fails on the duplicate email address. She has to use the CSV upload to correct the user's name.

      It would be useful to have this controlled by a capability to enable system admins to either:

      • prevent accounts with duplicate emails altogether, or
      • allow accounts with duplicate emails consistently

      I realise there has been a great deal of discussion on whether this feature should be available at all (e.g. MDL-38104) but, given that nobody appears to have seriously suggested removing the option from the CSV upload, we need to be able to control it properly.

      (Hopefully this won't kick off another argument about whether duplicate email addresses should be allowed! I've seen some good arguments for either side, but none of them hold true for every Moodle implementation, so I think this should be an informed decision by the people running the service, which the proposed improvement would enable.)

            maherne Michael Aherne
            maherne Michael Aherne
            John Okely John Okely
            Dan Poltawski Dan Poltawski
            Andrew Lyons Andrew Lyons
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.