Skip to content

Commit

Permalink
MDL-12911 fixed permission checks; merged from MOODLE_18_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 10, 2008
1 parent 77e2e3f commit cb3883c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion course/loginas.php
Expand Up @@ -61,8 +61,9 @@
print_error('nologinas');
}
$context = $systemcontext;
} else if (has_capability('moodle/user:loginas', $coursecontext)) {
} else {
require_login($course);
require_capability('moodle/user:loginas', $coursecontext);
if (!has_capability('moodle/course:view', $coursecontext, $userid, false)) {
error('This user is not in this course!');
}
Expand Down

0 comments on commit cb3883c

Please sign in to comment.