Skip to content
Snippets Groups Projects
Commit 70153669 authored by Alexander Bias's avatar Alexander Bias
Browse files

Adopt code changes in Moodle 3.5 core auth_ldap

parent 38f8efdb
No related branches found
No related tags found
No related merge requests found
...@@ -72,6 +72,8 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap { ...@@ -72,6 +72,8 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
function sync_users($do_updates=true) { function sync_users($do_updates=true) {
global $CFG, $DB; global $CFG, $DB;
require_once($CFG->dirroot . '/user/profile/lib.php');
mtrace(get_string('connectingldap', 'auth_ldap')); mtrace(get_string('connectingldap', 'auth_ldap'));
$ldapconnection = $this->ldap_connect(); $ldapconnection = $this->ldap_connect();
...@@ -349,7 +351,9 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap { ...@@ -349,7 +351,9 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
$maxxcount = 100; $maxxcount = 100;
foreach ($users as $user) { foreach ($users as $user) {
if (!$this->update_user_record($user->username, $updatekeys, true)) { $userinfo = $this->get_userinfo($user->username);
if (!$this->update_user_record($user->username, $updatekeys, true,
$this->is_user_suspended((object) $userinfo))) {
$skipped = ' - '.get_string('skipped'); $skipped = ' - '.get_string('skipped');
} }
else { else {
...@@ -416,8 +420,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap { ...@@ -416,8 +420,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
} }
// Save custom profile fields. // Save custom profile fields.
$updatekeys = $this->get_profile_keys(true); $this->update_user_record($user->username, $this->get_profile_keys(true), false);
$this->update_user_record($user->username, $updatekeys, false);
// Add roles if needed. // Add roles if needed.
$this->sync_roles($euser); $this->sync_roles($euser);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment