diff --git a/blocks/online_users/block_online_users.php b/blocks/online_users/block_online_users.php index caa25307e7b..7c65c47732a 100644 --- a/blocks/online_users/block_online_users.php +++ b/blocks/online_users/block_online_users.php @@ -153,6 +153,7 @@ class block_online_users extends block_base { $this->content->text .= $user->fullname.''; } if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and + has_capability('moodle/site:sendmessage', $context) and !isguest() and $user->username != 'guest') { // Only when logged in and messaging active etc $this->content->text .= '
';