From: skodak Date: Sat, 15 Dec 2007 16:57:20 +0000 (+0000) Subject: MDL-12580 fixed infinite redirect loop when editing profile for the first time; merge... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8b3dc20253c6e2be86089036b36484a9ec747c3b;p=moodle.git MDL-12580 fixed infinite redirect loop when editing profile for the first time; merged from MOODLE_19_STABLE --- diff --git a/user/edit.php b/user/edit.php index 094525328d..db8a645f42 100644 --- a/user/edit.php +++ b/user/edit.php @@ -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.