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

Webservice core_user_update_user allows dublicate e-mail adresse

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.2, 3.2.5
    • Fix Version/s: 3.2.6, 3.3.3
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-51945-master

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17