Quantcast
Channel: Authentication
Viewing all articles
Browse latest Browse all 8256

Re: Problem writing to LDAP AD after upload users

$
0
0
by Iñaki Arenaza.  

Whether this is a bug or a feature is always debatable wink, but right now external updates are only performed on manual changes (it's always been like that, btw).

Regarding the workaround, look for these lines in admin/tool/index.php (around line 596 in Moodle 2.4):

            if($doupdate or $existinguser->password !== $oldpw){
                // we want only users that were really updated

                $DB->update_record('user', $existinguser);
 


and change them to look like these:


            if($doupdate or $existinguser->password !== $oldpw){
                // we want only users that were really updated

                $olduser = $DB->get_record('user', array('id' => $existinguser->id));                                       
                try {
                    $auth->user_update($olduser, $existinguser);
                } catch (Exception $e){
                    // Ignore the exception
                }

                $DB->update_record('user', $existinguser);
 


When you upload users and update any details of them, the new lines will force a LDAP update for each modified user. Note that I talk about modified user(s). If you don't modify any user details, the LDAP update will not be triggered.

Saludos.
Iñaki.

Viewing all articles
Browse latest Browse all 8256

Trending Articles