Merge pull request #5832 from BOINC/dpa_forum9

web: forums: fix 'mark all threads as read' function
This commit is contained in:
Vitalii Koshura 2024-10-04 10:38:29 +02:00 committed by GitHub
commit 7d74d5e32e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 11 deletions

View File

@ -23,17 +23,6 @@ require_once('../inc/forum.inc');
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:
@ -204,6 +193,17 @@ if (DISABLE_FORUMS && !is_admin($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);