mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-12580 fixed infinite redirect loop when editing profile for the first time; merged from MOODLE_19_STABLE
This commit is contained in:
parent
32462b2c10
commit
8b3dc20253
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user