MDL-8840 Loginas cleanup
This commit is contained in:
+2
-1
@@ -399,12 +399,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ($USER->id != $user->id && has_capability('moodle/user:loginas', $coursecontext) &&
|
||||
if ($USER->id != $user->id && empty($USER->realuser) && has_capability('moodle/user:loginas', $coursecontext) &&
|
||||
! has_capability('moodle/site:doanything', $coursecontext, $user->id, false)) {
|
||||
echo '<form action="'.$CFG->wwwroot.'/course/loginas.php" method="get">';
|
||||
echo "<div>";
|
||||
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
|
||||
echo '<input type="hidden" name="user" value="'.$user->id.'" />';
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
echo '<input type="submit" value="'.get_string('loginas').'" />';
|
||||
echo "</div>";
|
||||
echo '</form>';
|
||||
|
||||
Reference in New Issue
Block a user