static $datestring;
static $countries;
static $isteacher;
+ static $isadmin;
if (empty($string)) { // Cache all the strings for the rest of the page
$countries = get_list_of_countries();
$isteacher = isteacher($course->id);
+ $isadmin = isadmin();
}
echo '<table width="80%" align="center" border="0" cellpadding="10" cellspacing="0" class="userinfobox">';
if ($isteacher) {
$timemidnight = usergetmidnight(time());
echo "<a href=\"$CFG->wwwroot/course/user.php?id=$course->id&user=$user->id\">$string->activity</a><br>";
- if (!iscreator($user->id)) { // Includes admins
+ if (!iscreator($user->id) or ($isadmin and !isadmin($user->id))) { // Includes admins
if ($course->category and isteacheredit($course->id) and isstudent($course->id, $user->id)) { // Includes admins
echo "<a href=\"$CFG->wwwroot/course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol</a><br />";
}
echo "<input type=submit value=\"".get_string("activityreport")."\">";
echo "</form></p></td>";
}
- if (isteacher($course->id) and ($USER->id != $user->id) and !iscreator($user->id)) {
+ if ((isadmin() and !isadmin($user->id)) or (isteacher($course->id) and ($USER->id != $user->id) and !iscreator($user->id))) {
echo "<td nowrap><p><form action=\"../course/loginas.php\" method=get>";
echo "<input type=hidden name=id value=\"$course->id\">";
echo "<input type=hidden name=user value=\"$user->id\">";