Skip to content

Commit

Permalink
Don't update user last visited on auto-refresh
Browse files Browse the repository at this point in the history
Fixes #23483
  • Loading branch information
atrol committed Oct 17, 2017
1 parent 2fba7ee commit 75da452
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions core/layout_api.php
Expand Up @@ -1091,9 +1091,13 @@ function layout_footer() {
# We do this at the end of the page so that:
# 1) we can display the user's last visit time on a page before updating it
# 2) we don't invalidate the user cache immediately after fetching it
# 3) don't do this on the password verification or update page, as it causes the
# 3) don't do this on pages that auto-refresh
# 4) don't do this on the password verification or update page, as it causes the
# verification comparison to fail
if( auth_is_user_authenticated() && !current_user_is_anonymous() && !( is_page_name( 'verify.php' ) || is_page_name( 'account_update.php' ) ) ) {
if( !gpc_get_bool( 'refresh' ) &&
auth_is_user_authenticated() &&
!current_user_is_anonymous() &&
!( is_page_name( 'verify.php' ) || is_page_name( 'account_update.php' ) ) ) {
$t_user_id = auth_get_current_user_id();
user_update_last_visit( $t_user_id );
}
Expand Down
5 changes: 3 additions & 2 deletions my_view_page.php
Expand Up @@ -69,8 +69,9 @@

layout_page_header_begin( lang_get( 'my_view_link' ) );

if( current_user_get_pref( 'refresh_delay' ) > 0 ) {
html_meta_redirect( 'my_view_page.php?refresh=true', current_user_get_pref( 'refresh_delay' ) * 60 );
$t_refresh_delay = current_user_get_pref( 'refresh_delay' );
if( $t_refresh_delay > 0 ) {
html_meta_redirect( 'my_view_page.php?refresh=true', $t_refresh_delay * 60 );
}

layout_page_header_end();
Expand Down
5 changes: 3 additions & 2 deletions view_all_bug_page.php
Expand Up @@ -91,7 +91,8 @@

layout_page_header_begin( lang_get( 'view_bugs_link' ) );

if( current_user_get_pref( 'refresh_delay' ) > 0 ) {
$t_refresh_delay = current_user_get_pref( 'refresh_delay' );
if( $t_refresh_delay > 0 ) {
$t_query = '?';

if( $f_page_number > 1 ) {
Expand All @@ -100,7 +101,7 @@

$t_query .= 'refresh=true';

html_meta_redirect( 'view_all_bug_page.php' . $t_query, current_user_get_pref( 'refresh_delay' ) * 60 );
html_meta_redirect( 'view_all_bug_page.php' . $t_query, $t_refresh_delay * 60 );
}

layout_page_header_end();
Expand Down

0 comments on commit 75da452

Please sign in to comment.