From 5b183f51a8bb55f9eeff42a14057f86cdc348b0e Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 20 Mar 2011 12:34:41 +0100 Subject: [PATCH] MDL-26859 do not show "my blog" link to guests and not-logged-in users --- blog/lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blog/lib.php b/blog/lib.php index 1137e8ec55e..e4ac2774a9e 100644 --- a/blog/lib.php +++ b/blog/lib.php @@ -398,12 +398,14 @@ function blog_get_all_options(moodle_page $page, stdClass $userid = null) { } // Get the options for the user - if ($user !== null) { + if ($user !== null and !isguestuser($user)) { // Load for the requested user $options[CONTEXT_USER+1] = blog_get_options_for_user($user); } // Load for the current user - $options[CONTEXT_USER] = blog_get_options_for_user(); + if (isloggedin() and !isguestuser()) { + $options[CONTEXT_USER] = blog_get_options_for_user(); + } } // If blog level is global then display a link to view all site entries