Permalink
Browse files

Don't show message shortcut icons when not logged in

  • Loading branch information...
1 parent cf68266 commit 4b22e391e4dc33af526fc350ae0184d1469f92a4 moodler committed Jan 21, 2005
Showing with 3 additions and 1 deletion.
  1. +3 −1 blocks/online_users/block_online_users.php
@@ -117,7 +117,9 @@ function get_content() {
$this->content->text .= '<img src="'.$CFG->pixpath.'/i/user.gif" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
}
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->instance->pageid.'" title="'.$timeago.'">'.$user->fullname.'</a>';
- $this->content->text .= '&nbsp;<a target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/user.php?id='.$user->id.'" onclick="return openpopup(\'/message/user.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img height="11" width="11" src="'.$CFG->pixpath.'/t/message.gif"></a>';
+ if (!empty($USER->id)) { // Only when logged in
+ $this->content->text .= '&nbsp;<a target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/user.php?id='.$user->id.'" onclick="return openpopup(\'/message/user.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img height="11" width="11" src="'.$CFG->pixpath.'/t/message.gif"></a>';
+ }
$this->content->text .= '</div>';
}
} else {

0 comments on commit 4b22e39

Please sign in to comment.