]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15821 do not show profile link in admin block if using guest account; merged...
authorskodak <skodak>
Thu, 24 Jul 2008 23:14:58 +0000 (23:14 +0000)
committerskodak <skodak>
Thu, 24 Jul 2008 23:14:58 +0000 (23:14 +0000)
blocks/admin/block_admin.php

index 6a228a21d362c68e30660f5a430af87e2abdf972..5f3b07240c0957b79d1acebb490e8a41b1bc855d 100644 (file)
@@ -217,9 +217,11 @@ class block_admin extends block_list {
             }
         }
 
-     /// Link to the user own profile
-        $this->content->items[]='<a href="'.$CFG->wwwroot.'/user/view.php?id='.$USER->id.'&amp;course='.$course->id.'">'.get_string('profile').'</a>';
-        $this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
+    /// Link to the user own profile (except guests)
+        if (!isguestuser() and isloggedin()) {
+            $this->content->items[]='<a href="'.$CFG->wwwroot.'/user/view.php?id='.$USER->id.'&amp;course='.$course->id.'">'.get_string('profile').'</a>';
+            $this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
+        }
 
         return $this->content;
     }