What happens to MNET remote users if I change the username?

What happens to MNET remote users if I change the username?

by David Bogner -
Number of replies: 5
Picture of Core developers Picture of Plugin developers

Hi,


we have got Moodle A (local users) and Moodle B (remote users from Moodle A). What happens if I change the username of a user on Moodle A? Does it break the link to the remote user profile on Moodle B of this user? Or is the username also changed on Moodle B?

Best regards,

David

Average of ratings: -
In reply to David Bogner

Re: What happens to MNET remote users if I change the username?

by Ken Task -
Picture of Particularly helpful Moodlers

Good question.  To the best of my knowledge, no syncing is done between MNet servers except when user from Moodle A attempts to login to Moodle B.

So a Moodle A user (hpotter) is a unique user.  If the user name in Moodle A is changed, then Moodle B wouldn't be advised of any change and probably try to register the user as a new user.  EMail address changed as well?

One way to find out for sure: create a user hpotter in Moodle A, enrol that user in a Moodle B course via MNet.  Make sure hpotter does participate (post to forum/take quiz, etc.).  Change hpotter user name in Moodle A and see what happens! ;)

If the system won't do it, the 'backdoor' *might be* to edit mdl_user table on Moodle B to match changes made on Moodle A.

'spirit of sharing', Ken

In reply to Ken Task

Re: What happens to MNET remote users if I change the username?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

I also think a new user would be created. I haven't tried with Moodle but this happened to me with Mahara Mnet when one of our staff got married and I changed her username in Moodle -when she went to Mahara it created her a new account. (So she's stuck with her maiden namesmile)

In reply to Mary Cooch

Re: What happens to MNET remote users if I change the username?

by Herb Wilson -

A new user is created. I found you can use the web services to change the username but you need to know the users internal moodle user table id. 

In reply to David Bogner

Re: What happens to MNET remote users if I change the username?

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi,

thank you, Herb and Mary for your responses. That's what I feared. So every time I change a username (what should hopefully not happen that often), I have to do an mysql query on all remote Peers like that:


UPDATE mdl_user SET username='newusername' WHERE username='oldusername' AND auth='mnet';

I also think, deleting a user is quite difficult: I can't delete MNET users, I only have the possibility to "Deny access". I will also have a look at the web services, that sounds promising.


Best regards,

David

In reply to David Bogner

Re: What happens to MNET remote users if I change the username?

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Correct. In MNet environment, users are identified with the username + peer id combination. If you want to change the username, you have to do it at all peers.