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

send new user passwords task fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.7.1
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:
      None
    • Affected Branches:
      MOODLE_27_STABLE

      Description

      Using an external database for authentication, the task send_new_user_passwords_task fails: "$user->auth" is not setting.

      Provisional solution:

      At moodle_dir/lib/classes/task/send_new_user_passwords_task.php

      Add "u.auth" field at line 55 (SQL)

      $newusers = $DB->get_recordset_sql("SELECT u.id as id, u.email,
      $usernamefields, u.username, u.lang,
      p.id as prefid, u.auth
      FROM {user} u
      JOIN {user_preferences} p ON u.id=p.userid
      WHERE p.name='create_password' AND p.value='1' AND
      u.email !='' AND u.suspended = 0 AND
      u.auth != 'nologin' AND u.deleted = 0");

      Replication steps:

      1) Make and poblate an external table for the authentication.

      2) Configure Moodle for authentication via external database plugin.

      3) Activate debbug messages.

      4) Run the script: moodle_dir/auth/db/cli/sync_users.php (by command line or cron)

      — All before is OK

      5) Run the script: moodle_dir/lib/classes/task/send_new_user_passwords_task.php (FAIL)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              miguelaf Miguel González
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: