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

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

por David Bogner -
Número de respuestas: 5
Imagen de Core developers Imagen de 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

Promedio de valuaciones (ratings): -
En respuesta a David Bogner

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

por Ken Task -
Imagen de 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

En respuesta a Ken Task

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

por Mary Cooch -
Imagen de Documentation writers Imagen de Moodle HQ Imagen de Particularly helpful Moodlers Imagen de Testers Imagen de 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 namesonrisa)

En respuesta a Mary Cooch

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

por 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. 

En respuesta a David Bogner

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

por David Bogner -
Imagen de Core developers Imagen de 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

En respuesta a David Bogner

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

por David Mudrák -
Imagen de Core developers Imagen de Documentation writers Imagen de Moodle HQ Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers Imagen de Plugins guardians Imagen de Testers Imagen de 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.