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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.8
    • 1.7.2
    • Authentication
    • None
    • MOODLE_17_STABLE
    • MOODLE_18_STABLE

      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.

            skodak Petr Skoda
            ppollet Patrick Pollet
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.