I've been trying to stop users from editing their profile.
I changed the student roll permission called Edit own user profile to Prevent, and when logging in as that user, they can still edit their profile.
Evan if I create a second roll and I assign it to the user, they can still edit their profile.
I discovered I can lock user fields, but you can't lock the users profile picture.
The user is not assigned any roll that would allow the editing of their profile.
I'm using Moodle 1.9.1+
Any help is very much appreciated,
Simon
Since user profiles are outside courses, changing moodle/user:editownprofile for the student role (normally given in a course) won't work. It should be changed for a system-wide role instead, such as the Authenticated user role.
I had my moodle setup to enable students to only see their courses, but now that I have assigned system roles to students, they can see all the courses.
If you only want students to be prevented from editing their profile, and not all users, you can create a new role, such as Restricted user as described in Demo teacher role, with moodle/user:editownprofile set to prevent, and assign it to all students in the system context.
Alternatively, you could change moodle/user:editownprofile to not set for the authenticated user role, then create a new role for teachers with moodle/user:editownprofile set to allow.
Before the ROLES changeover, there used to be the simplest little hack (a line or two) that we could paste into the config.php file. It prevented changing pictures.
Does that simple hack (wherever it is, and I wish someone would supply it); does that simple hack not work any more?
Thanks!
Actually, I just found the hack in an old version, 1.5.4+. It's this in the config.php file:
// Prevent users from updating their profile images
// $CFG->disableuserimages = true;
Would that cause problems putting it in a 1.9.5+ file (about a month old)?
Thanks again!
Thanks! I'm happy to know that works.
The problem with other courses didn't affect my application because I have only one other course, and it's hidden.
A major advantage to this newer application 1.9.5 as opposed to the lines in the config.php file back in 1.5.4 is that teachers or administrators can still change photos while students can't. Under the OLD system, teachers had to disable the line in the config.php file, make the changes, then go back to enable the line in config.php. This is a LOT easier! I'm happy to say that!
Hi Helen
Thanks for the tip. I used the "Demo teacher role" method before, but I'm having problems with these students showing everywhere on the site because they have system roles.
Regarding the alternative way (change moodle/user:editownprofile to not set for the authenticated user role, then create a new role for teachers with moodle/user:editownprofile set to allow): that would require this new teacher role to be set as context=system and the teachers to be given this role at the system level, right ?
I'm struggling to find a way to allow some to and modify their profile prevent the rest from modifying their profile without giving any a system-wide role. Isn't that possible ?
Am somewhat perplexed as well, but most likely I missed something somewhere:
Edit own user (profilemoodle/user:editownprofile) is not allowed for students in Site Admin / Users / Permissions / Define roles, yet students can still edit their own name / email / password in /user/edit.php
In my particular case I integrate with a 3rd party application that takes care of the login, so I don't want students to change their login info inside of moodle.
How would I do that?
This one is in the Roles FAQ: https://docs.moodle.org/28/en/Roles_FAQ#How_can_I_prevent_a_user_from_changing_their_own_password.3F
Wow. How do you spell "Moodle is awesome"?