Skip to content

Commit

Permalink
Merge pull request #5832 from BOINC/dpa_forum9
Browse files Browse the repository at this point in the history
web: forums: fix 'mark all threads as read' function
  • Loading branch information
AenBleidd authored Oct 4, 2024
2 parents 80b9cff + ec47f08 commit 7d74d5e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions html/user/forum_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@
require_once('../inc/pm.inc');
require_once('../inc/time.inc');

// Process request to mark all posts as read
//
if ((get_int("read", true) == 1)) {
if ($user) {
check_tokens($user->authenticator);
$now = time();
$user->prefs->update("mark_as_read_timestamp=$now");
Header("Location: ".get_str("return", true));
}
}

function show_forum_summary($forum) {
switch ($forum->parent_type) {
case 0:
Expand Down Expand Up @@ -204,6 +193,17 @@ function do_unsubscribe($user) {
error_page("Forums are disabled");
}

// Process request to mark all posts as read
//
if ((get_int("read", true) == 1)) {
if ($user) {
check_tokens($user->authenticator);
$now = time();
$user->prefs->update("mark_as_read_timestamp=$now");
Header("Location: ".get_str("return", true));
}
}

$submit = post_str('submit', true);
if ($submit) {
do_unsubscribe($user);
Expand Down

0 comments on commit 7d74d5e

Please sign in to comment.