aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/acp/acp_users.php18
-rw-r--r--phpBB/includes/session.php2
-rw-r--r--phpBB/language/en/acp/index.htm10
-rw-r--r--phpBB/posting.php11
4 files changed, 31 insertions, 10 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 5de6031c1e..3a7e86616f 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -829,6 +829,22 @@ class acp_users
$s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>';
}
+ if ($config['load_onlinetrack'])
+ {
+ $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline
+ FROM ' . SESSIONS_TABLE . "
+ WHERE session_user_id = $user_id";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $user_row['session_time'] = (isset($row['session_time'])) ? $row['session_time'] : 0;
+ $user_row['session_viewonline'] = (isset($row['session_viewonline'])) ? $row['session_viewonline'] : 0;
+ unset($row);
+ }
+
+ $last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit'];
+
$template->assign_vars(array(
'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
@@ -849,7 +865,7 @@ class acp_users
'USER' => $user_row['username'],
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
'REGISTERED_IP' => ($ip == 'hostname') ? gethostbyaddr($user_row['user_ip']) : $user_row['user_ip'],
- 'USER_LASTACTIVE' => ($user_row['user_lastvisit']) ? $user->format_date($user_row['user_lastvisit']) : ' - ',
+ 'USER_LASTACTIVE' => ($last_visit) ? $user->format_date($last_visit) : ' - ',
'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 40ed6b98ae..1ac5d8fde7 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -690,7 +690,7 @@ class session
$del_user_id = array();
$del_sessions = 0;
- while ($row = $db->sql_fetchrow($result));
+ while ($row = $db->sql_fetchrow($result))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_lastvisit = ' . (int) $row['recent_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
diff --git a/phpBB/language/en/acp/index.htm b/phpBB/language/en/acp/index.htm
new file mode 100644
index 0000000000..ee1f723a7d
--- /dev/null
+++ b/phpBB/language/en/acp/index.htm
@@ -0,0 +1,10 @@
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF" text="#000000">
+
+</body>
+</html>
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 67a9acbeab..3e11492323 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -428,12 +428,6 @@ if ($mode != 'post' && $config['allow_topic_notify'] && $user->data['is_register
$db->sql_freeresult($result);
}
-// If the user is replying or posting and not already watching this topic but set to always being notified we need to overwrite this setting
-if ($mode != 'edit' && $config['allow_topic_notify'] && $user->data['is_registered'] && !$post_data['notify_set'])
-{
- $post_data['notify_set'] = $user->data['user_notify'];
-}
-
// Do we want to edit our post ?
if ($mode == 'edit' && $post_data['bbcode_uid'])
{
@@ -1091,8 +1085,9 @@ $sig_checked = $post_data['enable_sig'];
$lock_topic_checked = (isset($topic_lock)) ? $topic_lock : (($post_data['topic_status'] == ITEM_LOCKED) ? 1 : 0);
$lock_post_checked = (isset($post_lock)) ? $post_lock : $post_data['post_edit_locked'];
-// If in edit mode, and the user is not the poster, we do not take the notification into account
-$notify_checked = (isset($notify)) ? $notify : (($mode == 'post') ? $user->data['user_notify'] : $post_data['notify_set']);
+// If the user is replying or posting and not already watching this topic but set to always being notified we need to overwrite this setting
+$notify_set = ($mode != 'edit' && $config['allow_topic_notify'] && $user->data['is_registered'] && !$post_data['notify_set']) ? $user->data['user_notify'] : $post_data['notify_set'];
+$notify_checked = (isset($notify)) ? $notify : (($mode == 'post') ? $user->data['user_notify'] : $notify_set);
// Page title & action URL, include session_id for security purpose
$s_action = append_sid("{$phpbb_root_path}posting.$phpEx", "mode=$mode&amp;f=$forum_id", true, $user->session_id);