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

creator role not set when adding new users via auth_sync_users against a ldap directory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.2
    • Fix Version/s: 1.8
    • Component/s: Authentication
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      Moodle new users created by nightly sync with LDAP directory are not assigned the creator role if they are members of the LDAP group mapped to "course creators".

      My guess is lines 608-610 of auth/ldap/lib.php, in function auth_sync_ldap that currently are :

      if(!empty($add_users)){
      print "User entries to add: ". count($add_users). "\n";

      if ($creatorroles = get_roles_with_capability('moodle/legacy:coursecreator', CAP_ALLOW))

      { $creatorrole = array_shift($roles); // We can only use one, let's use the first one <--- HERE }

      should be (like they are in lines 560-562 of the update users section) :

      if(!empty($add_users)){
      print "User entries to add: ". count($add_users). "\n";

      if ($creatorroles = get_roles_with_capability('moodle/legacy:coursecreator', CAP_ALLOW))

      { $creatorrole = array_shift($creatorroles); // We can only use one, let's use the first one }

      the $roles variable do not exist in the script , so the test if (isset($creatorrole->id) just fails in line 611 later ...

      Cheers.

        Attachments

          Activity

            People

            • Assignee:
              skodak Petr Skoda
              Reporter:
              ppollet Patrick Pollet
              Tester:
              Nobody
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                31/Mar/07