Skip to content

Commit

Permalink
MDL-24258: eliminate student capability to delete their post when it …
Browse files Browse the repository at this point in the history
…exceeded the max editing time.
  • Loading branch information
rwijaya committed Sep 23, 2010
1 parent 60a1a25 commit 09d40d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mod/forum/post.php
Expand Up @@ -353,6 +353,13 @@
$PAGE->navbar->add(get_string('delete', 'forum'));
$PAGE->set_title($course->shortname);
$PAGE->set_heading($course->fullname);

$timepassed = time() - $post->created;
if (($timepassed > $CFG->maxeditingtime) && !has_capability('mod/forum:deleteanypost', $modcontext)) {
print_error("cannotdeletepost", "forum",
forum_go_back_to("discuss.php?d=$post->discussion"));
}

if ($replycount) {
if (!has_capability('mod/forum:deleteanypost', $modcontext)) {
print_error("couldnotdeletereplies", "forum",
Expand Down

0 comments on commit 09d40d6

Please sign in to comment.