From ed7431a37b591cdf51c68f620a6de8e5c605be9c Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 7 Aug 2017 09:42:23 +0800 Subject: [PATCH] MDL-59734 auth_ldap: Fix role sync 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. --- auth/ldap/auth.php | 2 +- auth/ldap/tests/plugin_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index dcfc2c59d2d..6cf1f2819ec 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -928,7 +928,7 @@ class auth_plugin_ldap extends auth_plugin_base { $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); diff --git a/auth/ldap/tests/plugin_test.php b/auth/ldap/tests/plugin_test.php index d50f67d38e9..f746583e6b1 100644 --- a/auth/ldap/tests/plugin_test.php +++ b/auth/ldap/tests/plugin_test.php @@ -110,7 +110,7 @@ class auth_ldap_plugin_testcase extends advanced_testcase { 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'); -- 2.43.0