mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-58635 blogs: check edited blog belongs to current user
This commit is contained in:
parent
dca8394630
commit
b7fcd09582
2 changed files with 6 additions and 5 deletions
|
@ -52,11 +52,11 @@ $action = (empty($id)) ? 'add' : 'edit';
|
||||||
|
|
||||||
$external = new stdClass();
|
$external = new stdClass();
|
||||||
|
|
||||||
// Check that this id exists.
|
// Retrieve the external blog record.
|
||||||
if (!empty($id) && !$DB->record_exists('blog_external', array('id' => $id))) {
|
if (!empty($id)) {
|
||||||
|
if (!$external = $DB->get_record('blog_external', array('id' => $id, 'userid' => $USER->id))) {
|
||||||
print_error('wrongexternalid', 'blog');
|
print_error('wrongexternalid', 'blog');
|
||||||
} else if (!empty($id)) {
|
}
|
||||||
$external = $DB->get_record('blog_external', array('id' => $id));
|
|
||||||
$external->autotags = core_tag_tag::get_item_tags_array('core', 'blog_external', $id);
|
$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['viewsiteentries'] = 'View all entries';
|
||||||
$string['viewuserentries'] = 'View all entries by {$a}';
|
$string['viewuserentries'] = 'View all entries by {$a}';
|
||||||
$string['worldblogs'] = 'The world can read entries set to be world-accessible';
|
$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['wrongpostid'] = 'Wrong blog post id';
|
||||||
$string['page-blog-edit'] = 'Blog editing pages';
|
$string['page-blog-edit'] = 'Blog editing pages';
|
||||||
$string['page-blog-index'] = 'Blog listing pages';
|
$string['page-blog-index'] = 'Blog listing pages';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue