MDL-12580 fixed infinite redirect loop when editing profile for the first time; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2007-12-15 16:57:20 +00:00
parent 32462b2c10
commit 8b3dc20253

View File

@ -55,8 +55,10 @@
// check access control
if ($user->id == $USER->id) {
//editing own profile
require_capability('moodle/user:editownprofile', $systemcontext);
//editing own profile - require_login() MUST NOT be used here, it would result in infinite loop!
if (!has_capability('moodle/user:editownprofile', $systemcontext)) {
error('Can not edit own profile, sorry.');
}
} else {
// teachers, parents, etc.