Skip to content

Commit

Permalink
Merge branch '3.3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
marc1706 committed Jul 13, 2024
2 parents 1449706 + 99c97b9 commit ca3e692
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion phpBB/includes/acp/acp_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ function main($id, $mode)
$s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>';
}

$last_active = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_last_active'];
$last_active = $user_row['user_last_active'] ?: ($user_row['session_time'] ?? 0);

$inactive_reason = '';
if ($user_row['user_type'] == USER_INACTIVE)
Expand Down
2 changes: 1 addition & 1 deletion phpBB/includes/functions_display.php
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl

if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline'))
{
$last_active = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_last_active'];
$last_active = $data['user_last_active'] ?: ($data['session_time'] ?? 0);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion phpBB/memberlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@
{
$row['session_time'] = $session_ary[$row['user_id']]['session_time'] ?? 0;
$row['session_viewonline'] = $session_ary[$row['user_id']]['session_viewonline'] ?? 0;
$row['last_visit'] = (!empty($row['session_time'])) ? $row['session_time'] : $row['user_last_active'];
$row['last_visit'] = $row['user_last_active'] ?: $row['session_time'];

$id_cache[$row['user_id']] = $row;
}
Expand Down
8 changes: 4 additions & 4 deletions phpBB/phpbb/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ function session_begin($update_session_page = true)
$this->check_ban_for_current_session($config);

// Update user last active time accordingly, but in a minute or so
if ((int) $this->data['session_time'] - (int) $this->data['user_last_active'] > 60)
if ($this->time_now - (int) $this->data['user_last_active'] > 60)
{
$this->update_last_active_time();
}
Expand Down Expand Up @@ -1718,7 +1718,7 @@ public function update_user_lastvisit()
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_lastvisit = ' . (int) $this->data['session_time'] . ',
user_last_active = ' . (int) $this->data['session_time'] . '
user_last_active = ' . $this->time_now . '
WHERE user_id = ' . (int) $this->data['user_id'];
$db->sql_query($sql);
}
Expand All @@ -1733,10 +1733,10 @@ public function update_last_active_time()
{
global $db;

if (isset($this->data['session_time'], $this->data['user_id']))
if (isset($this->time_now, $this->data['user_id']))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_last_active = ' . (int) $this->data['session_time'] . '
SET user_last_active = ' . $this->time_now . '
WHERE user_id = ' . (int) $this->data['user_id'];
$db->sql_query($sql);
}
Expand Down

0 comments on commit ca3e692

Please sign in to comment.