There's no way to achieve this other than tampering with the code. You can block the possibility of changing the profiles by editing the user/edit.html file.
For example, if you would like to block the possibility of changing the first name, locate the following piece of code (lines 56-57):
<td><input type="text" name="firstname" size="30" maxlength="20" value="<?php p($user->firstname) ?>">
<?php if (isset($err["firstname"])) formerr($err["firstname"]); ?>
and change it to:
<td><?php p($user->firstname) ?>
Other fields can be blocked in the same way.
Hope this helps,
Przemek
I would like to disable the "Edit Profile" since I do not wish my students having funky names at the end of each day.
Thank You
Hi!
I am in the same situation and I am trying to find the answer to it. Did you manage to figure out how to disable the Edit Profile Option and leave only Change Password? I tried to do via Authentication, but it did not work.
Regards,
Maria
if you look at the file view.php in /user/
At lines 124 to 128.
"
echo "<p><form action=\"$wwwroot/user/edit.php\" method=\"get\">";
echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
echo "<input type=\"hidden\" name=\"course\" value=\"$course->id\" />";
echo "<input type=\"submit\" value=\"".get_string("editmyprofile")."\" />";
echo "</form></p>";
"
If you look at this is where it draws the button when u click on ur name and the edit profile shows.
if you want you could put:
"
if (isadmin()) {
echo "<p><form action=\"$wwwroot/user/edit.php\" method=\"get\">";
echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
echo "<input type=\"hidden\" name=\"course\" value=\"$course->id\" />";
echo "<input type=\"submit\" value=\"".get_string("editmyprofile")."\" />";
echo "</form></p>";
}
"
This will basically only show the edit button form to the admins of this application other users will then not see their edit button.
This is a quick way to do it. Or you could also just simply comment these lines so the form wont show the button at all.
Ken's solution will hide the link to the user profile page. But this will not completely prevent students changing their profile because there are other ways of accessing the same page.
(Hiding links is not the way to prevent students accessing pages. I have noticed that some students are very keen on finding pages that have no visible links to them. It is mostly these students of course who also like to change names )
Moodle 1.5 -- the beginning of this discussion daes from more than 1 year ago! -- now includes the ability to lock fields in the userprofile.That way you can make sure students don't change names on every (bad) occasion.
See this discussion
simply do
<td><input type="hidden" name="firstname" size="30" maxlength="20" value="<?php p($user->firstname) ?>"><?php p($user->firstname) ?></td>
this basically will create a hidden value field with firstname which the script should still get and show the first name as a label text and not an input textbox