diff -r 000000000000 -r f9ffdbd96607 punbb/admin_users.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/punbb/admin_users.php Wed Jul 11 21:01:48 2007 -0400
@@ -0,0 +1,511 @@
+ PUN_MOD)
+ message($lang_common['No permission']);
+
+
+// Show IP statistics for a certain user ID
+if (isset($_GET['ip_stats']))
+{
+ $ip_stats = intval($_GET['ip_stats']);
+ if ($ip_stats < 1)
+ message($lang_common['Bad request']);
+
+
+ $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
+ require PUN_ROOT.'header.php';
+
+?>
+
+
+
+
Users
+
+
+
+
+
+ IP address |
+ Last used |
+ Times found |
+ Action |
+
+
+
+query('SELECT poster_ip, MAX(posted) AS last_used, COUNT(id) AS used_times FROM '.$db->prefix.'posts WHERE poster_id='.$ip_stats.' GROUP BY poster_ip ORDER BY last_used DESC') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+ if ($db->num_rows($result))
+ {
+ while ($cur_ip = $db->fetch_assoc($result))
+ {
+
+?>
+
+ |
+ |
+ |
+ Find more users for this ip |
+
+There are currently no posts by that user in the forum. | '."\n";
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
Users
+
+
+
+
+
+ Username |
+ E-mail |
+ Title/Status |
+ Posts |
+ Admin note |
+ Actions |
+
+
+
+query('SELECT DISTINCT poster_id, poster FROM '.$db->prefix.'posts WHERE poster_ip=\''.$db->escape($ip).'\' ORDER BY poster DESC') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+ $num_posts = $db->num_rows($result);
+
+ if ($num_posts)
+ {
+ // Loop through users and print out some info
+ for ($i = 0; $i < $num_posts; ++$i)
+ {
+ list($poster_id, $poster) = $db->fetch_row($result);
+
+ $result2 = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND u.id='.$poster_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+
+ if (($user_data = $db->fetch_assoc($result2)))
+ {
+ $user_title = get_title($user_data);
+
+ $actions = 'View IP stats - Show posts';
+
+?>
+
+ '.pun_htmlspecialchars($user_data['username']).'' ?> |
+ |
+ |
+ |
+ |
+ |
+
+
+
+ |
+ |
+ Guest |
+ |
+ |
+ |
+
+The supplied IP address could not be found in the database. | '."\n";
+
+?>
+
+
+
+
+
+
+
+'.$last_post_after;
+ if ($last_post_before != '')
+ $conditions[] = 'u.last_post<'.$last_post_before;
+ if ($registered_after != '')
+ $conditions[] = 'u.registered>'.$registered_after;
+ if ($registered_before != '')
+ $conditions[] = 'u.registered<'.$registered_before;
+
+ $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
+ while (list($key, $input) = @each($form))
+ {
+ if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note')))
+ $conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
+ }
+
+ if ($posts_greater != '')
+ $conditions[] = 'u.num_posts>'.$posts_greater;
+ if ($posts_less != '')
+ $conditions[] = 'u.num_posts<'.$posts_less;
+
+ if ($user_group != 'all')
+ $conditions[] = 'u.group_id='.intval($user_group);
+
+ if (empty($conditions))
+ message('You didn\'t enter any search terms.');
+
+
+ $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
+ require PUN_ROOT.'header.php';
+
+?>
+
+
+
+
Users
+
+
+
+
+
+ Username |
+ E-mail |
+ Title/Status |
+ Posts |
+ Admin note |
+ Actions |
+
+
+
+query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+ if ($db->num_rows($result))
+ {
+ while ($user_data = $db->fetch_assoc($result))
+ {
+ $user_title = get_title($user_data);
+
+ // This script is a special case in that we want to display "Not verified" for non-verified users
+ if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])
+ $user_title = 'Not verified';
+
+ $actions = 'View IP stats - Show posts';
+
+?>
+
+ '.pun_htmlspecialchars($user_data['username']).'' ?> |
+ |
+ |
+ |
+ |
+ |
+
+No match. | '."\n";
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+