Skip to content

Commit

Permalink
MDL-59734 auth_ldap: Fix role sync
Browse files Browse the repository at this point in the history
The unit tests were failing because the upgrade step was missed.
In addition, there was a typo in a variable name, which meant that the
role was not actually synchronised.
  • Loading branch information
andrewnicols committed Aug 7, 2017
1 parent 8146b1f commit ed7431a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auth/ldap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ function sync_users($do_updates=true) {

$id = user_create_user($user, false);
echo "\t"; print_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $id));
$user = $DB->get_record('user', array('id' => $id));

if (!empty($this->config->forcechangepassword)) {
set_user_preference('auth_forcepasswordchange', 1, $id);
Expand Down
2 changes: 1 addition & 1 deletion auth/ldap/tests/plugin_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function test_auth_ldap() {
set_config('user_attribute', 'cn', 'auth_ldap');
set_config('memberattribute', 'memberuid', 'auth_ldap');
set_config('memberattribute_isdn', 0, 'auth_ldap');
set_config('creators', 'cn=creators,'.$topdn, 'auth_ldap');
set_config('coursecreatorcontext', 'cn=creators,'.$topdn, 'auth_ldap');
set_config('removeuser', AUTH_REMOVEUSER_KEEP, 'auth_ldap');

set_config('field_map_email', 'mail', 'auth_ldap');
Expand Down

0 comments on commit ed7431a

Please sign in to comment.