Howto set $currentuser = false; in usr/view.php if roleid = 8

Howto set $currentuser = false; in usr/view.php if roleid = 8

by Stefan Eberhard -
Number of replies: 3
I found out, that you can prevent an usergroup from editing their profiles if you set $currentuser = false;
in user/view.php
but I do not know how to implement something like
if roleid=8 then $currentuser = false;
in view.php

With this small hack I could create an anonymous usergrup to take tests (as guests cannot take tests!) but prevent this usergroup from editing their profile or changing their passwort.
This could help also Bente (see thraed before)
Average of ratings: -
In reply to Stefan Eberhard

Re: Howto set $currentuser = false; in usr/view.php if roleid = 8

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Can't you just change the role definition so that these users don't have the moodle/user:editownprofile capability?
In reply to Tim Hunt

Re: Howto set $currentuser = false; in usr/view.php if roleid = 8

by Stefan Eberhard -
editownprofile
This feature should come with 1.9 , isn´t it?
I tried several role changings in 1.8.3, but had no working result.


In reply to Stefan Eberhard

Re: Howto set $currentuser = false; in usr/view.php if roleid = 8

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Yes, the capability moodle/user:editownprofile is included in Moodle 1.9.