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

ldap authentication: Sync users fails to add new users but updates existing users during cli/sync_users.php execution. Errors with Unable to write to database

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.2.3
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a new user in one of your configured LDAP contexts, with a username of '0' (zero, without the quotes).
      2. Before applying the patch
        1. Run auth/ldap/cli/sync.php. It should display some errors like "Notice: Undefined property: stdClass::$username in /.../auth/ldap/auth.php on line 848
          !!! Error writing to database !!!..." and stop the syncing process.
      3. After applying the patch
        1. Run auth/ldap/cli/sync.php It should run without problems and sync all the users.
      Show
      Create a new user in one of your configured LDAP contexts, with a username of '0' (zero, without the quotes). Before applying the patch Run auth/ldap/cli/sync.php. It should display some errors like "Notice: Undefined property: stdClass::$username in /.../auth/ldap/auth.php on line 848 !!! Error writing to database !!!..." and stop the syncing process. After applying the patch Run auth/ldap/cli/sync.php It should run without problems and sync all the users.
    • Affected Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      wip_master_mdl-33406

      Description

      when running sync_users.php to update moodle db from ldap directory (Active Directory in my case) existing user details are updated but new users are not and the php script finishes with "!!! Error Writing to Database !!!" Enabling debugging and rerunning the script gives the additional error
      "Notice undefined property: stdClass::$username in /pathtoWeb/auth/ldap/auth.php on line 848

      The issue is discussed here http://moodle.org/mod/forum/discuss.php?d=203600

      Note: noticed the problem earlier but wasn't a show stopper for me at the time so earlier versions of moodle may be also affected

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: