aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/language/en/lang_main.php9
-rw-r--r--phpBB/styles/subSilver/template/overall_header.html4
-rw-r--r--phpBB/styles/subSilver/template/viewonline_body.html2
-rw-r--r--phpBB/styles/subSilver/template/viewonline_whois.html15
-rw-r--r--phpBB/viewonline.php45
5 files changed, 62 insertions, 13 deletions
diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php
index 97abf7d5d2..70dd941910 100644
--- a/phpBB/language/en/lang_main.php
+++ b/phpBB/language/en/lang_main.php
@@ -358,6 +358,7 @@ $lang = array(
'LOGIN' => 'Login',
+ 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.',
'TERMS_USE' => 'Terms of Use',
'PRIVACY' => 'Privacy Policy',
'FORGOT_PASS' => 'I forgot my password',
@@ -1222,6 +1223,8 @@ $lang += array(
'VIEW_ONLINE_TIMES' => 'This data is based on users active over the past %d minutes', // 2 minutes, etc.
'FORUM_LOCATION' => 'Forum Location',
'LAST_UPDATED' => 'Last Updated',
+ 'IP' => 'IP', // IP: x.x.x.x or somedomain.com
+ 'WHOIS' => 'Whois',
'READING_FORUM' => 'Viewing topics in %s',
'READING_TOPIC' => 'Reading topic in %s',
'POSTING_MESSAGE' => 'Posting message in %s',
@@ -1232,12 +1235,6 @@ $lang += array(
'VIEWING_ONLINE' => 'Viewing who is online',
'VIEWING_MEMBERS' => 'Viewing member details',
'VIEWING_MESSAGES' => 'Viewing Private Messages',
- 'VIEWING_FAQ' => 'Viewing FAQ',
-
- 'SEARCHING_FORUMS' => 'Searching forums',
- 'VIEWING_ONLINE' => 'Viewing who is online',
- 'VIEWING_MEMBERS' => 'Viewing member details',
- 'VIEWING_MESSAGES' => 'Viewing Private Messages',
'VIEWING_FAQ' => 'Viewing FAQ'
);
diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html
index 93bafe4e74..c4be311a5c 100644
--- a/phpBB/styles/subSilver/template/overall_header.html
+++ b/phpBB/styles/subSilver/template/overall_header.html
@@ -26,9 +26,9 @@ if ({S_NEW_PM})
}
<!-- ENDIF -->
-function im_popup(url, width, height)
+function popup(url, width, height)
{
- window.open(url, '_contact', 'HEIGHT=' + height + ',resizable=yes,scrollbars=yes, WIDTH=' + width);
+ window.open(url, '_popup', 'HEIGHT=' + height + ',resizable=yes,scrollbars=yes, WIDTH=' + width);
return false;
}
diff --git a/phpBB/styles/subSilver/template/viewonline_body.html b/phpBB/styles/subSilver/template/viewonline_body.html
index a679352fc2..ba504700f9 100644
--- a/phpBB/styles/subSilver/template/viewonline_body.html
+++ b/phpBB/styles/subSilver/template/viewonline_body.html
@@ -17,7 +17,7 @@
<!-- ELSE -->
<tr class="row2">
<!-- ENDIF -->
- <td class="row1" width="35%">&nbsp;<span class="gen"><!-- IF reg_user_row.U_USER_PROFILE --><a href="{reg_user_row.U_USER_PROFILE}" title="{reg_user_row.USER_IP}"><!-- ENDIF -->{reg_user_row.USERNAME}<!-- IF reg_user_row.U_USER_PROFILE --></a><!-- ENDIF -->&nbsp;</span></td>
+ <td class="row1" width="35%"><p class="gen"><!-- IF reg_user_row.U_USER_PROFILE --><a href="{reg_user_row.U_USER_PROFILE}"><!-- ENDIF -->{reg_user_row.USERNAME}<!-- IF reg_user_row.U_USER_PROFILE --></a><!-- ENDIF -->&nbsp;</p><!-- IF reg_user_row.USER_IP --><p class="gensmall">{L_IP}: <a href="{reg_user_row.U_USER_IP}">{reg_user_row.USER_IP}</a> &#187; <a href="{reg_user_row.U_WHOIS}" onclick="popup('{reg_user_row.U_WHOIS}', 750, 500);return false">{L_WHOIS}</a></p><!-- ENDIF --></td>
<td class="row1" width="25%" align="center" nowrap="nowrap"><span class="gen">&nbsp;{reg_user_row.LASTUPDATE}&nbsp;</span></td>
<td class="row1" width="40%">&nbsp;<a class="gen" href="{reg_user_row.U_FORUM_LOCATION}">{reg_user_row.FORUM_LOCATION}</a>&nbsp;</td>
</tr>
diff --git a/phpBB/styles/subSilver/template/viewonline_whois.html b/phpBB/styles/subSilver/template/viewonline_whois.html
new file mode 100644
index 0000000000..8d939befc6
--- /dev/null
+++ b/phpBB/styles/subSilver/template/viewonline_whois.html
@@ -0,0 +1,15 @@
+<!-- INCLUDE simple_header.html -->
+
+ <!-- $Id$ -->
+
+ <table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <th>{L_WHOIS}</th>
+ </tr>
+ <tr>
+ <td class="row1"><pre>{WHOIS}</pre></td>
+ </tr>
+ </table>
+
+
+<!-- INCLUDE simple_footer.html --> \ No newline at end of file
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 0f363fcf70..293bdf070d 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -22,9 +22,11 @@ $auth->acl($user->data);
$user->setup();
// Get and set some variables
-$start = request_var('start', 0);
-$sort_key = request_var('sk', 'b');
-$sort_dir = request_var('sd', 'd');
+$mode = request_var('mode', '');
+$user_id = request_var('u', 0);
+$start = request_var('start', 0);
+$sort_key = request_var('sk', 'b');
+$sort_dir = request_var('sd', 'd');
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED']);
$sort_key_sql = array('a' => 'username', 'b' => 'session_time', 'c' => 'session_page');
@@ -32,6 +34,39 @@ $sort_key_sql = array('a' => 'username', 'b' => 'session_time', 'c' => 'session_
// Sorting and order
$order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
+// Whois requested
+if ($mode == 'whois')
+{
+ include($phpbb_root_path.'includes/functions_admin.'.$phpEx);
+
+ $sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip
+ FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s
+ WHERE u.user_id = $user_id
+ AND s.session_user_id = u.user_id";
+ $result = $db->sql_query($sql);
+
+ if ($row = $db->sql_fetchrow($result))
+ {
+ $whois = ipwhois($row['session_ip']);
+ $whois = preg_replace('#(\s+?)([\w\-\._\+]+?@[\w\-\.]+?)(\s+?)#s', '\1<a href="mailto:\2">\2</a>\3', $whois);
+ $whois = preg_replace('#(\s+?)(http://.*?)(\s+?)#s', '\1<a href="\2" target="_blank">\2</a>\3', $whois);
+
+ $template->assign_vars(array(
+ 'WHOIS' => trim($whois))
+ );
+ }
+ $db->sql_freeresult($result);
+
+ // Output the page
+ page_header($user->lang['WHO_IS_ONLINE']);
+
+ $template->set_filenames(array(
+ 'body' => 'viewonline_whois.html')
+ );
+ make_jumpbox('viewforum.'.$phpEx);
+
+ page_footer();
+}
// Forum info
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
@@ -187,11 +222,13 @@ while ($row = $db->sql_fetchrow($result))
'USERNAME' => $username,
'LASTUPDATE' => $user->format_date($row['session_time']),
'FORUM_LOCATION'=> $location,
- 'USER_IP' => ($auth->acl_get('a_')) ? $row['session_ip'] : $user->lang['HIDDEN'],
+ 'USER_IP' => ($auth->acl_get('a_')) ? (($mode == 'lookup' && $user_id == $row['user_id']) ? gethostbyaddr($row['session_ip']) : $row['session_ip']) : '',
'S_ROW_COUNT' => $$which_counter,
'U_USER_PROFILE' => ($row['user_type'] <> USER_IGNORE) ? "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'] : '',
+ 'U_USER_IP' => "viewonline.$phpEx$SID" . (($mode != 'lookup') ? '&amp;mode=lookup&amp;u=' . $row['user_id'] : ''),
+ 'U_WHOIS' => "viewonline.$phpEx$SID&amp;mode=whois&amp;u=" . $row['user_id'],
'U_FORUM_LOCATION' => $location_url)
);