Updating existing users' data

Updating existing users' data

by Mustafa A. -
Number of replies: 12

Hello,

I set up LDAP authentication on Moodle 3.0.3 with Active Directory server.

Moodle users were created successfully. Then, I added some extra User profile fields and configured their mapping. Some mappings are set to update the local "On creation" and some of them are "On every login".

Now, when a user logs in, his data is updated (including the extra fields). But I want to update all users' data at once. I schedule a task, but the extra fields are not updated sad

How can I update the data of existing users without requiring them to log in.

Execute scheduled task: LDAP users sync job (auth_ldap\task\sync_task)
... started 15:05:45. Current memory use 4MB.
Connecting to LDAP server...
Creating temporary table tmp_extuser
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Got 1735 records from LDAP
No user entries to be removed
No user entries to be revived
User entries to be updated: 1749
	Updating user aaronb id 3
	Updating user abdulkadirkar id 4
	Updating user abdullahak id 5
No user entries to be added... used 12517 dbqueries
... used 28.172491073608 seconds
Scheduled task complete: LDAP users sync job (auth_ldap\task\sync_task)

Average of ratings: -
In reply to Mustafa A.

Re: Updating existing users' data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

And the fields aren't locked?

In reply to Emma Richardson

Re: Updating existing users' data

by Mustafa A. -

they are locked. Should they be unlocked?

I don't want the users to be able to change their titles, or departments themselves.

In reply to Mustafa A.

Re: Updating existing users' data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry, my bad.  I misread something.  Yes, they should be locked.  So, everything updates when they log in but just not with the sync?  How is your bind set up?  

In reply to Emma Richardson

Re: Updating existing users' data

by Mustafa A. -

Yes, that's the problem.

We have a MS Active Directory Server. I set up LDAP Server plugin, and configured the data mappings. They are updated correctly when the user logs in, but not with sync.

NTLM SSO is enabled and working fine. We have SSL.

In reply to Mustafa A.

Re: Updating existing users' data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

And are you using a bind user to access MSAD or just using the user credentials.  That might be the issue - if you do not have a bind user that can access all the accounts, I wonder if that is what is causing issues with the sync. 

On another site that was having sync issues, I seem to remember that SE Linux was causing a problem.  That might be another place to look.

In reply to Emma Richardson

Re: Updating existing users' data

by Mustafa A. -

we have a bind user.

and we are running on Windows sad

In reply to Mustafa A.

Re: Updating existing users' data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Is anything updating on the sync?  If you change a regular field, does that update correctly?

In reply to Emma Richardson

Re: Updating existing users' data

by Mustafa A. -

Yes, I altered some data in mdl_user table by hand, than run the synchronization. The data is corrected with the value coming via LDAP.

But, data in mdl_user_info_data is not corrected after synchronization. It's corrected only after that user logs in.

In reply to Emma Richardson

Re: Updating existing users' data

by Mustafa A. -

Also, I can get the required fields into mdl_user table via synchronization. But I can not get them into extra user profile fields.

In reply to Mustafa A.

Re: Updating existing users' data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Sounds like a bug with the sync.  I bet it only affects the user table.  I suggest filing a bug report on the tracker.