mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
Merged blog theme/lang fixes from MDL-10833
This commit is contained in:
parent
4bc4ca50a6
commit
673bc55dc2
2 changed files with 7 additions and 3 deletions
|
@ -9,7 +9,7 @@ $id = optional_param('id', 0, PARAM_INT);
|
||||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||||
$courseid = optional_param('courseid', 0, PARAM_INT); // needed for user tab - does nothing here
|
$courseid = optional_param('courseid', 0, PARAM_INT); // needed for user tab - does nothing here
|
||||||
|
|
||||||
require_login();
|
require_login($courseid);
|
||||||
|
|
||||||
if (empty($CFG->bloglevel)) {
|
if (empty($CFG->bloglevel)) {
|
||||||
error('Blogging is disabled!');
|
error('Blogging is disabled!');
|
||||||
|
|
|
@ -74,7 +74,7 @@ switch ($filtertype) {
|
||||||
}
|
}
|
||||||
$courseid = $course->id;
|
$courseid = $course->id;
|
||||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||||
require_login($course->id);
|
require_login($course);
|
||||||
if (!has_capability('moodle/blog:view', $coursecontext)) {
|
if (!has_capability('moodle/blog:view', $coursecontext)) {
|
||||||
error('You do not have the required permissions to view blogs in this course');
|
error('You do not have the required permissions to view blogs in this course');
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ switch ($filtertype) {
|
||||||
}
|
}
|
||||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||||
$courseid = $course->id;
|
$courseid = $course->id;
|
||||||
require_login($course->id);
|
require_login($course);
|
||||||
if (!has_capability('moodle/blog:view', $coursecontext)) {
|
if (!has_capability('moodle/blog:view', $coursecontext)) {
|
||||||
error('You do not have the required permissions to view blogs in this course/group');
|
error('You do not have the required permissions to view blogs in this course/group');
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,10 @@ switch ($filtertype) {
|
||||||
}
|
}
|
||||||
$userid = $filterselect;
|
$userid = $filterselect;
|
||||||
|
|
||||||
|
if (!empty($courseid)) {
|
||||||
|
require_login($courseid);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue