MDL-26859 do not show "my blog" link to guests and not-logged-in users

This commit is contained in:
Petr Skoda 2011-03-20 12:34:41 +01:00
parent fd85ceac57
commit 5b183f51a8

View File

@ -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