diff --git a/user/index.php b/user/index.php index 8eceb9de38f..85319dcd17b 100644 --- a/user/index.php +++ b/user/index.php @@ -36,6 +36,9 @@ error("Context ID is incorrect"); } } + // not needed anymore + unset($contextid); + unset($courseid); require_login($course->id); @@ -46,16 +49,16 @@ } } else { // no roles yet if (has_capability('moodle/user:assign', $context)) { - redirect($CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id); + redirect($CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id); } else { - error ('no participants found for this course'); + error ('no participants found for this course'); } } if (!has_capability('moodle/course:viewparticipants', $context) && !has_capability('moodle/site:viewparticipants', $context)) { print_error('nopermissions'); - } + } if (!$course->category) { if (!has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_SYSTEM, SITEID))) { @@ -157,16 +160,16 @@ echo '
| '; print_group_picture($group, $course->id, true, false, false); echo ' | ';
@@ -247,7 +250,7 @@
}
}
-
+
if ($roles = get_roles_used_in_context($context)) {
foreach ($roles as $role) {
$rolenames[$role->id] = strip_tags(format_string($role->name)); // Used in menus etc later on
@@ -310,23 +313,23 @@
$listofcontexts = '('.implode(',', $usercontexts).')';
} else {
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
- $listofcontexts = '('.$sitecontext->id.')'; // must be site
+ $listofcontexts = '('.$sitecontext->id.')'; // must be site
}
if ($roleid) {
$selectrole = " AND r.roleid = $roleid ";
} else {
$selectrole = " ";
}
- $select = 'SELECT u.id, u.username, u.firstname, u.lastname, u.email, u.city, u.country,
+ $select = 'SELECT u.id, u.username, u.firstname, u.lastname, u.email, u.city, u.country,
u.picture, u.lang, u.timezone, u.emailstop, u.maildisplay, ul.timeaccess AS lastaccess '; // s.lastaccess
//$select .= $course->enrolperiod?', s.timeend ':'';
$from = "FROM {$CFG->prefix}user u INNER JOIN
{$CFG->prefix}role_assignments r on u.id=r.userid LEFT OUTER JOIN
{$CFG->prefix}user_lastaccess ul on r.userid=ul.userid ";
- $where = "WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts)
+ $where = "WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts)
AND u.deleted = 0 $selectrole
AND (ul.courseid = $course->id OR ul.courseid IS NULL)
- AND u.username <> 'guest' ";
+ AND u.username <> 'guest' ";
$where .= get_lastaccess_sql($accesssince);
$wheresearch = '';
@@ -370,7 +373,7 @@
echo ' ';
echo get_string('currentrole', 'role').': ';
$rolenames = array(0 => get_string('all')) + $rolenames;
- popup_form('index.php?contextid='.$context->id.'&sifirst=&silast=&roleid=', $rolenames,
+ popup_form('index.php?contextid='.$context->id.'&sifirst=&silast=&roleid=', $rolenames,
'rolesform', $roleid, '');
echo ' ';
}
|