MDL-47408 user: Add checking before adding blog's link.

Checking enableblogs  and bloglevel, userid, constant  BLOG_USER_LEVEL.
This commit is contained in:
Dmitry Nefedov 2014-10-01 16:53:31 +08:00
parent e2e1c98a7f
commit 66b864c797

View File

@ -691,7 +691,7 @@ if ($mode === MODE_USERDETAILS) { // Print simple listing.
$links = array();
if ($CFG->enableblogs && $CFG->bloglevel > 0) {
if ($CFG->enableblogs && ($CFG->bloglevel != BLOG_USER_LEVEL || $USER->id == $user->id)) {
$links[] = html_writer::link(new moodle_url('/blog/index.php?userid='.$user->id), get_string('blogs', 'blog'));
}