MDL-36713 Blog: Display accurate error when a guest views a user blog
This commit is contained in:
+1
-1
@@ -79,7 +79,7 @@ if (empty($CFG->enableblogs)) {
|
||||
}
|
||||
|
||||
if (isguestuser()) {
|
||||
print_error('noguestentry', 'blog');
|
||||
print_error('noguest');
|
||||
}
|
||||
|
||||
$returnurl = new moodle_url('/blog/index.php');
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ if ($CFG->bloglevel == BLOG_GLOBAL_LEVEL) {
|
||||
require_login();
|
||||
if (isguestuser()) {
|
||||
// They must have entered the url manually.
|
||||
print_error('blogdisable', 'blog');
|
||||
print_error('noguest');
|
||||
}
|
||||
|
||||
} else if ($CFG->bloglevel == BLOG_USER_LEVEL) {
|
||||
|
||||
@@ -63,6 +63,10 @@ if (empty($CFG->enableblogs)) {
|
||||
print_error('blogdisable', 'blog');
|
||||
}
|
||||
|
||||
if (isguestuser()) {
|
||||
print_error('noguest');
|
||||
}
|
||||
|
||||
// The preference is site wide not blog specific. Hence user should have permissions in site level.
|
||||
require_capability('moodle/blog:view', $sitecontext);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user