Skip to content
Permalink
Browse files

MDL-53755 forum: Check session when marking posts

  • Loading branch information...
andrewnicols committed Apr 8, 2016
1 parent e4e7a09 commit 01408d619ba89d32f9ad83308990ff9b0374cb57
Showing with 5 additions and 4 deletions.
  1. +2 −2 mod/forum/index.php
  2. +2 −2 mod/forum/lib.php
  3. +1 −0 mod/forum/markposts.php
@@ -230,7 +230,7 @@
} else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) {
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
$unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
$forum->id.'&amp;mark=read"><img src="'.$OUTPUT->pix_url('t/markasread') . '" alt="'.$strmarkallread.'" class="iconsmall" /></a></span>';
$forum->id.'&amp;mark=read&amp;sesskey=' . sesskey() . '"><img src="'.$OUTPUT->pix_url('t/markasread') . '" alt="'.$strmarkallread.'" class="iconsmall" /></a></span>';
} else {
$unreadlink = '<span class="read">0</span>';
}
@@ -368,7 +368,7 @@
} else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) {
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
$unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
$forum->id.'&amp;mark=read"><img src="'.$OUTPUT->pix_url('t/markasread') . '" alt="'.$strmarkallread.'" class="iconsmall" /></a></span>';
$forum->id.'&amp;mark=read&sesskey=' . sesskey() . '"><img src="'.$OUTPUT->pix_url('t/markasread') . '" alt="'.$strmarkallread.'" class="iconsmall" /></a></span>';
} else {
$unreadlink = '<span class="read">0</span>';
}
@@ -3714,7 +3714,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring
echo $post->unread;
echo '</a>';
echo '<a title="'.$strmarkalldread.'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='.
$forum->id.'&amp;d='.$post->discussion.'&amp;mark=read&amp;returnpage=view.php">' .
$forum->id.'&amp;d='.$post->discussion.'&amp;mark=read&amp;returnpage=view.php&amp;sesskey=' . sesskey() . '">' .
'<img src="'.$OUTPUT->pix_url('t/markasread') . '" class="iconsmall" alt="'.$strmarkalldread.'" /></a>';
echo '</span>';
} else {
@@ -5402,7 +5402,7 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions = -1, $
if ($forumtracked) {
echo '<a title="'.get_string('markallread', 'forum').
'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='.
$forum->id.'&amp;mark=read&amp;returnpage=view.php">'.
$forum->id.'&amp;mark=read&amp;returnpage=view.php&amp;sesskey=' . sesskey() . '">'.
'<img src="'.$OUTPUT->pix_url('t/markasread') . '" class="iconsmall" alt="'.get_string('markallread', 'forum').'" /></a>';
}
echo '</th>';
@@ -55,6 +55,7 @@
$user = $USER;
require_login($course, false, $cm);
require_sesskey();
if ($returnpage == 'index.php') {
$returnto = new moodle_url("/mod/forum/$returnpage", array('id' => $course->id));

0 comments on commit 01408d6

Please sign in to comment.
You can’t perform that action at this time.