Skip to content

Commit

Permalink
MDL-36713 Blog: Display accurate error when a guest views a user blog
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourget committed Aug 16, 2016
1 parent 6f302b1 commit 67a1f63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blog/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
}

if (isguestuser()) {
print_error('noguestentry', 'blog');
print_error('noguest');
}

$returnurl = new moodle_url('/blog/index.php');
Expand Down
2 changes: 1 addition & 1 deletion blog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
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) {
Expand Down
4 changes: 4 additions & 0 deletions blog/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
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);

Expand Down

0 comments on commit 67a1f63

Please sign in to comment.