]> git.mjollnir.org Git - moodle.git/commitdiff
Don't show message shortcut icons when not logged in
authormoodler <moodler>
Fri, 21 Jan 2005 02:29:29 +0000 (02:29 +0000)
committermoodler <moodler>
Fri, 21 Jan 2005 02:29:29 +0000 (02:29 +0000)
blocks/online_users/block_online_users.php

index 05a67fef5176bba9df10e4649afe69c574026c93..5f75eb53bb8b0f866cda548b83d2ca697c3bc004 100644 (file)
@@ -117,7 +117,9 @@ class block_online_users extends block_base {
                     $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 {