Browse Source

Limited report messages by role

master
Marco Rougeth 10 years ago
parent
commit
b5add05fb7
  1. 7
      index.php

7
index.php

@ -81,10 +81,17 @@ $data = $DB->get_records_sql($sql, array_merge($param_users,$param_users,$param_
foreach ($data as $user) { foreach ($data as $user) {
$roles = role_fix_names(get_user_roles($context, $user->id)); $roles = role_fix_names(get_user_roles($context, $user->id));
$possible_role = false;
$str_roles = ""; $str_roles = "";
foreach ($roles as $role) { foreach ($roles as $role) {
if(!$possible_role && in_array($role->localname, Array("Estudante"))) {
$possible_role = true;
}
$str_roles .= $role->localname.", "; $str_roles .= $role->localname.", ";
} }
if(!$possible_role) {
continue;
}
$str_roles = substr($str_roles, 0, -2); $str_roles = substr($str_roles, 0, -2);
$upic = $OUTPUT->user_picture($user); $upic = $OUTPUT->user_picture($user);
$ulink = "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&course={$course->id}\">{$upic}</a>"; $ulink = "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&course={$course->id}\">{$upic}</a>";

Loading…
Cancel
Save