Prevent users from changing usernames

Prevent users from changing usernames

by Luis de Vasconcelos -
Number of replies: 4

Is it possible to prevent students or teachers from updating the username field on student profiles? I want to prevent all users (except admins) from changing student usernames.

All our users are authenticated against LDAP and it causes problems (like duplicate user records) when non-admins change student usernames in Moodle and then the student logs in again using their original username.

Thanks.

Average of ratings: -
In reply to Luis de Vasconcelos

Re: Prevent users from changing usernames

by Randy Orwin -
Try looking at the settings on the LDAP configuration page at Administration-> Users ->Authentication -> LDAP Server. You can set the various fields at the bottom of the page to "Update Local", "Update External" and to lock the fields. If you set the "Update Local" option to "on every login" then LDAP is always queried and that is the data that will be used. When using this setting you want to make sure and lock the field so that it can only be updated via LDAP. I hope this is what you are looking for.

Randy
Average of ratings: Useful (1)
In reply to Randy Orwin

Re: Prevent users from changing usernames

by Luis de Vasconcelos -
Thanks, but the Username field isn't one of the options available in the LDAP Server settings. You can't lock the Username field.
In reply to Luis de Vasconcelos

Re: Prevent users from changing usernames

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Users can't change their username, only admins can.

Log in as a 'normal' user and check your profile page, there's no way to edit your username.

Average of ratings: Useful (2)
In reply to Luis de Vasconcelos

Re: Prevent users from changing usernames

by Randy Orwin -
I would agree with Richard. If your teachers can change user names then I would check your role assignments as by default they aren't allowed to change user names and users themselves aren't allowed to change user names once the account has been created.
Average of ratings: Useful (1)