From b5add05fb776f33d93de69e1fc2a511c2f5ac2bf Mon Sep 17 00:00:00 2001 From: Marco Rougeth Date: Mon, 17 Nov 2014 15:51:39 -0200 Subject: [PATCH] Limited report messages by role --- index.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.php b/index.php index 314832f..19719a3 100644 --- a/index.php +++ b/index.php @@ -81,10 +81,17 @@ $data = $DB->get_records_sql($sql, array_merge($param_users,$param_users,$param_ foreach ($data as $user) { $roles = role_fix_names(get_user_roles($context, $user->id)); + $possible_role = false; $str_roles = ""; foreach ($roles as $role) { + if(!$possible_role && in_array($role->localname, Array("Estudante"))) { + $possible_role = true; + } $str_roles .= $role->localname.", "; } + if(!$possible_role) { + continue; + } $str_roles = substr($str_roles, 0, -2); $upic = $OUTPUT->user_picture($user); $ulink = "wwwroot}/user/view.php?id={$user->id}&course={$course->id}\">{$upic}";