MDL-12580 fixed infinite redirect loop when editing profile for the first time

This commit is contained in:
skodak
2007-12-15 16:56:33 +00:00
parent 138b92ce7f
commit 504e7efe76
+4 -2
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.