mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-58635 blogs: check edited blog belongs to current user
This commit is contained in:
parent
dca8394630
commit
b7fcd09582
@ -52,11 +52,11 @@ $action = (empty($id)) ? 'add' : 'edit';
|
||||
|
||||
$external = new stdClass();
|
||||
|
||||
// Check that this id exists.
|
||||
if (!empty($id) && !$DB->record_exists('blog_external', array('id' => $id))) {
|
||||
print_error('wrongexternalid', 'blog');
|
||||
} else if (!empty($id)) {
|
||||
$external = $DB->get_record('blog_external', array('id' => $id));
|
||||
// Retrieve the external blog record.
|
||||
if (!empty($id)) {
|
||||
if (!$external = $DB->get_record('blog_external', array('id' => $id, 'userid' => $USER->id))) {
|
||||
print_error('wrongexternalid', 'blog');
|
||||
}
|
||||
$external->autotags = core_tag_tag::get_item_tags_array('core', 'blog_external', $id);
|
||||
}
|
||||
|
||||
|
@ -185,6 +185,7 @@ $string['viewmyentriesaboutcourse'] = 'View my entries about this course';
|
||||
$string['viewsiteentries'] = 'View all entries';
|
||||
$string['viewuserentries'] = 'View all entries by {$a}';
|
||||
$string['worldblogs'] = 'The world can read entries set to be world-accessible';
|
||||
$string['wrongexternalid'] = 'Wrong external blog id';
|
||||
$string['wrongpostid'] = 'Wrong blog post id';
|
||||
$string['page-blog-edit'] = 'Blog editing pages';
|
||||
$string['page-blog-index'] = 'Blog listing pages';
|
||||
|
Loading…
x
Reference in New Issue
Block a user