Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
7873e36f
Commit
7873e36f
authored
Apr 08, 2016
by
Andrew Nicols
Browse files
MDL-53755 forum: Check session when marking posts
parent
6336c562
Changes
3
Hide whitespace changes
Inline
Side-by-side
mod/forum/index.php
View file @
7873e36f
...
...
@@ -230,7 +230,7 @@ if ($generalforums) {
}
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
.
'&mark=read"><img src="'
.
$OUTPUT
->
pix_url
(
't/markasread'
)
.
'" alt="'
.
$strmarkallread
.
'" class="iconsmall" /></a></span>'
;
$forum
->
id
.
'&mark=read
&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 @@ if ($course->id != SITEID) { // Only real courses have learning forums
}
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
.
'&mark=read"><img src="'
.
$OUTPUT
->
pix_url
(
't/markasread'
)
.
'" alt="'
.
$strmarkallread
.
'" class="iconsmall" /></a></span>'
;
$forum
->
id
.
'&mark=read
&sesskey='
.
sesskey
()
.
'
"><img src="'
.
$OUTPUT
->
pix_url
(
't/markasread'
)
.
'" alt="'
.
$strmarkallread
.
'" class="iconsmall" /></a></span>'
;
}
else
{
$unreadlink
=
'<span class="read">0</span>'
;
}
...
...
mod/forum/lib.php
View file @
7873e36f
...
...
@@ -3805,7 +3805,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
.
'&d='
.
$post
->
discussion
.
'&mark=read&returnpage=view.php">'
.
$forum
->
id
.
'&d='
.
$post
->
discussion
.
'&mark=read&returnpage=view.php
&sesskey='
.
sesskey
()
.
'
">'
.
'<img src="'
.
$OUTPUT
->
pix_url
(
't/markasread'
)
.
'" class="iconsmall" alt="'
.
$strmarkalldread
.
'" /></a>'
;
echo
'</span>'
;
}
else
{
...
...
@@ -5486,7 +5486,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
.
'&mark=read&returnpage=view.php">'
.
$forum
->
id
.
'&mark=read&returnpage=view.php
&sesskey='
.
sesskey
()
.
'
">'
.
'<img src="'
.
$OUTPUT
->
pix_url
(
't/markasread'
)
.
'" class="iconsmall" alt="'
.
get_string
(
'markallread'
,
'forum'
)
.
'" /></a>'
;
}
echo
'</th>'
;
...
...
mod/forum/markposts.php
View file @
7873e36f
...
...
@@ -55,6 +55,7 @@ if (!$cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
$user
=
$USER
;
require_login
(
$course
,
false
,
$cm
);
require_sesskey
();
if
(
$returnpage
==
'index.php'
)
{
$returnto
=
forum_go_back_to
(
new
moodle_url
(
"/mod/forum/
$returnpage
"
,
array
(
'id'
=>
$course
->
id
)));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment