MDL-8840 Loginas cleanup, some more improvements; merged from MOODLE_18_STABLE

+ merging of format_string fixes
This commit is contained in:
skodak 2007-03-20 07:42:41 +00:00
parent be78d45dd2
commit 3887fe4acd
4 changed files with 30 additions and 30 deletions

View file

@ -27,6 +27,11 @@
error("That's an invalid course id");
}
/// do not use when in course login as
if (!empty($USER->realuser) and $USER->loginascontext->contextlevel == CONTEXT_COURSE) {
print_error('loginasnoenrol', '', $CFG->wwwroot.'/course/view.php?id='.$USER->loginascontext->instanceid);
}
$enrol = enrolment_factory::factory($course->enrol); // do not use if (!$enrol... here, it can not work in PHP4 - see MDL-7529
/// Refreshing all current role assignments for the current user