]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fixes for guest display from stable
authormoodler <moodler>
Fri, 20 Oct 2006 05:16:12 +0000 (05:16 +0000)
committermoodler <moodler>
Fri, 20 Oct 2006 05:16:12 +0000 (05:16 +0000)
blocks/online_users/block_online_users.php

index bd8dec262d3185c03e94e95d354fcf916e47eba7..697724ac12328002cf8ef9b8144747a992b46d11 100644 (file)
@@ -97,7 +97,8 @@ class block_online_users extends block_base {
                 $timeago = format_time(time() - max($user->timeaccess, $user->lastaccess)); //bruno to calculate correctly on frontpage 
                 $this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true).' ';
                 $this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$COURSE->id.'" title="'.$timeago.'">'.$user->fullname.'</a>';
-                if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and !isguest()) {  // Only when logged in
+                if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and 
+                    !isguest() and $user->username != 'guest') {  // Only when logged in and messaging active etc
                     $this->content->text .= "\n".' <a title="'.get_string('messageselectadd').'" target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="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="messageicon" src="'.$CFG->pixpath.'/t/message.gif" alt="'. get_string('messageselectadd') .'" /></a>';
                 }