From fd5e633e8344bc4f290e2a27de70aff8c8580dbf Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 25 Nov 2005 07:09:04 +0000 Subject: [PATCH] fix for bug #4314 --- mod/forum/post.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mod/forum/post.php b/mod/forum/post.php index cd30c22d36c..a4cda1b5402 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -89,6 +89,17 @@ } else if ($post->edit) { // Updating a post $post->id = $post->edit; $message = ''; + + //fix for bug #4314 + if (!$realpost = get_record('forum_posts','id',$post->id)){ + $realpost = new object; + $realpost->userid = -1; + } + + if ($realpost->userid <> $USER->id && !isadmin()){ + error ("you can not update this post"); + } + if (forum_update_post($post,$message)) { add_to_log($course->id, "forum", "update post",