Skip to content

Commit

Permalink
online user block MDL-15325 Online Users Block didn't perform capabil…
Browse files Browse the repository at this point in the history
…ity check when displaying messaging icon, merged from 19
  • Loading branch information
jerome committed Jan 8, 2009
1 parent 4413941 commit 593bebe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions blocks/online_users/block_online_users.php
Expand Up @@ -153,6 +153,7 @@ function get_content() {
$this->content->text .= $user->fullname.'</a></div>';
}
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 .= '<div class="message"><a title="'.get_string('messageselectadd').'" href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="this.target=\'message_'.$user->id.'\';return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);">'
.'<img class="iconsmall" src="'.$CFG->pixpath.'/t/message.gif" alt="'. get_string('messageselectadd') .'" /></a></div>';
Expand Down

0 comments on commit 593bebe

Please sign in to comment.