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

Webservice core_user_update_user allows dublicate e-mail adresse

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_32_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MDL-51945-master
    • Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Setup a service in Moodle (Site Administration > Plugins > Webservices > External Service), adding the core_user_update_users WS.
      3. Create a token for an admin user (Site Administration > Plugins > Webservices > Manage protocols) for the service
      4. Disable the allowaccountssameemail global site setting
      5. Using this PHP client try to update an existing user account using an email address already in use in the site (by a different user). In the php client, you will need to use the core_user_update_users WS and remove all the $user1 and $user2 data except $user1->id and $user1->email
      6. Check that after running the WS, the email is not updated in the user profile.
      7. Enable the allowaccountssameemail global site setting
      8. Run again the WS client and check that this time the email is successfully updated and you have two users in the site using the same email address
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Setup a service in Moodle (Site Administration > Plugins > Webservices > External Service), adding the core_user_update_users WS. Create a token for an admin user (Site Administration > Plugins > Webservices > Manage protocols) for the service Disable the allowaccountssameemail global site setting Using this PHP client try to update an existing user account using an email address already in use in the site (by a different user). In the php client, you will need to use the core_user_update_users WS and remove all the $user1 and $user2 data except $user1->id and $user1->email Check that after running the WS, the email is not updated in the user profile. Enable the allowaccountssameemail global site setting Run again the WS client and check that this time the email is successfully updated and you have two users in the site using the same email address

      1. Create two users with email adresse 1@test.com and 2@test.com
      2. Update user 2 using the web service core_user_update_user to email-adresse 1@test.com

      Result:
      This user 2 gets updated e-mail adresse to 1@test.com

      Expected result:
      The web service should have thrown a validation error

            jleyva Juan Leyva
            tuekorsgaard Tue Korsgaard
            Ankit Agarwal Ankit Agarwal
            David Monllaó David Monllaó
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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