From 5f6fc25b43d2849373a935344d119a6533be6e05 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 18 Oct 2006 07:50:22 +0000 Subject: [PATCH] merged fix for MDL-7066, users will replypost set to prohit can not edit own post --- mod/forum/post.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mod/forum/post.php b/mod/forum/post.php index 0b2705ba67..a6dfd05563 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -115,9 +115,15 @@ $realpost = new object; $realpost->userid = -1; } - - if ( !(($realpost->userid == $USER->id && has_capability('mod/forum:replypost', $modcontext)) || - has_capability('mod/forum:editanypost', $modcontext)) ) { + + + // if user has edit any post capability + // or has either startnewdiscussion or reply capability and is editting own post + // then he can proceed + // MDL-7066 + if ( !(($realpost->userid == $USER->id && (has_capability('mod/forum:replypost', $modcontext) + || has_capability('mod/forum:startdiscussion', $modcontext))) || + has_capability('mod/forum:editanypost', $modcontext)) ) { error("You can not update this post"); } -- 2.39.5