From 9fbccd390742155959d725898646026b03e91251 Mon Sep 17 00:00:00 2001 From: vyshane Date: Mon, 13 Nov 2006 03:27:41 +0000 Subject: [PATCH] Merged from 1.7 --- mod/forum/lib.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 64bb482725e..af8ced1d830 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -2036,6 +2036,9 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link $commands[] = ''.$strparent.''; } + $editownpost = $ownpost && has_capability('mod/forum:replypost', $modcontext); + } else { + $editownpost = $ownpost && has_capability('mod/forum:startdiscussion', $modcontext); } $forumtype = get_field('forum', 'type', 'id', $post->forum); @@ -2048,7 +2051,10 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link $age = 0; } $editanypost = has_capability('mod/forum:editanypost', $modcontext); - if ($ownpost or $editanypost) { + + + + if ($editownpost or $editanypost) { if (($age < $CFG->maxeditingtime) or $editanypost) { $commands[] = ''.$stredit.''; } @@ -2061,12 +2067,13 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link '" title="'.$strpruneheading.'">'.$strprune.''; } - if (($ownpost and $age < $CFG->maxeditingtime) or - has_capability('mod/forum:editanypost', $modcontext)) { + if (($ownpost and $age < $CFG->maxeditingtime + and has_capability('mod/forum:deleteownpost', $modcontext)) + or has_capability('mod/forum:deleteanypost', $modcontext)) { $commands[] = ''.$strdelete.''; } - if ($reply) { + if ($reply and has_capability('mod/forum:replypost', $modcontext)) { $commands[] = ''.$strreply.''; }