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

Changing a user name with LDAP authentication results in an error

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites

      An LDAP server with at least one user.

      Testing

      1. Set up LDAP ("Site administration" > "Plugins" > "Authentication" > "Manage authentication")
      2. Ensure the setting "Synchronize local username" is set to "No"
      3. Run the LDAP synchronisation script:

        php admin/tool/task/cli/schedule_task.php --execute=\\auth_ldap\\task\\sync_task

      4. Browse to "Site administration" > "Users" > "Accounts" > "Browse a list of users"
      5. Find the user(s) that were created when you synced with the LDAP server (they may have blank usernames)
      6. Edit one
      7. Verify the username field is disabled
      8. Change the "Choose an authentication method" field and verify that the username field is enabled for:
        • Email-based self-registration
        • Manual accounts
        • No login
        • External database
        • LTI
        • No authentication
      9. Verify it is disabled for anything else
      10. Verify you can change the user's first name with one of the auth types that causes the username to be disabled
      11. Verify you can change the user's first name with one of the auth types that doesn't cause the username to be disabled
      12. Verify you can change the username of a user when the auth type doesn't disable it
      Show
      Prerequisites An LDAP server with at least one user. Testing Set up LDAP ("Site administration" > "Plugins" > "Authentication" > "Manage authentication") Ensure the setting "Synchronize local username" is set to "No" Run the LDAP synchronisation script: php admin/tool/task/cli/schedule_task.php --execute=\\auth_ldap\\task\\sync_task Browse to "Site administration" > "Users" > "Accounts" > "Browse a list of users" Find the user(s) that were created when you synced with the LDAP server (they may have blank usernames) Edit one Verify the username field is disabled Change the "Choose an authentication method" field and verify that the username field is enabled for: Email-based self-registration Manual accounts No login External database LTI No authentication Verify it is disabled for anything else Verify you can change the user's first name with one of the auth types that causes the username to be disabled Verify you can change the user's first name with one of the auth types that doesn't cause the username to be disabled Verify you can change the username of a user when the auth type doesn't disable it
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-35104-master-2
    • Sprint:
      3.2 Sprint 1

      Description

      Sometimes you need to change the username in Moodle because there has been a legal name change and your hands are tied. However if you do this with manual authentication (no problem) with ldap auth you get an error message generated.

      Replication steps:

      1. Log in as Admin
      2. Pick a user with ldap authentication
      3. Change username (to match change in AD that has been done manually)
      4. Sit back and see the error message

      The Moodle server tries to update AD - but I don't want AD to be updated.

      Error message:

      Failed to update user data on external auth: ldap. See the server logs for more details.
       
      More information about this error
      Debug info:
      Error code: cannotupdateuseronexauth
      Stack trace:
       
          line 467 of \lib\setuplib.php: moodle_exception thrown
          line 184 of \user\editadvanced.php: call to print_error()
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cameron1729 cameron1729
              Reporter:
              jgcracknell James Cracknell
              Peer reviewer:
              Jake Dallimore
              Integrator:
              Andrew Nicols
              Tester:
              Jun Pataleta
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              12 Vote for this issue
              Watchers:
              20 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jul/16