punbb/admin_users.php
author Dan
Thu, 12 Jul 2007 01:04:01 -0400
changeset 2 a8a21e1c7afa
parent 0 f9ffdbd96607
child 3 c0c445d4a13e
permissions -rw-r--r--
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     1
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     2
/***********************************************************************
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     3
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     4
  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     5
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     6
  This file is part of PunBB.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     7
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     8
  PunBB is free software; you can redistribute it and/or modify it
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     9
  under the terms of the GNU General Public License as published
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    10
  by the Free Software Foundation; either version 2 of the License,
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    11
  or (at your option) any later version.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    12
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    13
  PunBB is distributed in the hope that it will be useful, but
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    14
  WITHOUT ANY WARRANTY; without even the implied warranty of
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    16
  GNU General Public License for more details.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    17
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    18
  You should have received a copy of the GNU General Public License
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    19
  along with this program; if not, write to the Free Software
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    20
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    21
  MA  02111-1307  USA
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    22
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    23
************************************************************************/
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    24
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    25
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    26
// Tell header.php to use the admin template
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    27
define('PUN_ADMIN_CONSOLE', 1);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    28
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    29
//define('PUN_ROOT', './');
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    30
//require PUN_ROOT.'include/common.php';
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    31
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    32
global $pun_db, $pun_user, $pun_config, $lang_common;
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    33
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    34
require PUN_ROOT.'include/common_admin.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    35
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    36
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    37
if ($pun_user['g_id'] < PUN_MOD)
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    38
	message($lang_common['No permission']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    39
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    40
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    41
// Show IP statistics for a certain user ID
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    42
if (isset($_GET['ip_stats']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    43
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    44
	$ip_stats = intval($_GET['ip_stats']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    45
	if ($ip_stats < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    46
		message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    47
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    48
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    49
	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    50
	require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    51
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    52
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    53
<div class="linkst">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    54
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    55
		<div><a href="javascript:history.go(-1)">Go back</a></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    56
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    57
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    58
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    59
<div id="users1" class="blocktable">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    60
	<h2><span>Users</span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    61
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    62
		<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    63
			<table cellspacing="0">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    64
			<thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    65
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    66
					<th class="tcl" scope="col">IP address</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    67
					<th class="tc2" scope="col">Last used</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    68
					<th class="tc3" scope="col">Times found</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    69
					<th class="tcr" scope="col">Action</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    70
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    71
			</thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    72
			<tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    73
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    74
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    75
	$result = $pun_db->query('SELECT poster_ip, MAX(posted) AS last_used, COUNT(id) AS used_times FROM '.$pun_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__, $pun_db->error());
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    76
	if ($pun_db->num_rows($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    77
	{
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
    78
		while ($cur_ip = $pun_db->fetch_assoc($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    79
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    80
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    81
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    82
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    83
					<td class="tcl"><a href="moderate.php?get_host=<?php echo $cur_ip['poster_ip'] ?>"><?php echo $cur_ip['poster_ip'] ?></a></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    84
					<td class="tc2"><?php echo format_time($cur_ip['last_used']) ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    85
					<td class="tc3"><?php echo $cur_ip['used_times'] ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    86
					<td class="tcr"><a href="admin_users.php?show_users=<?php echo $cur_ip['poster_ip'] ?>">Find more users for this ip</a></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    87
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    88
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    89
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    90
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    91
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    92
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    93
		echo "\t\t\t\t".'<tr><td class="tcl" colspan="4">There are currently no posts by that user in the forum.</td></tr>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    94
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    95
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    96
			</tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    97
			</table>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    98
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    99
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   100
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   101
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   102
<div class="linksb">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   103
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   104
		<div><a href="javascript:history.go(-1)">Go back</a></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   105
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   106
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   107
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   108
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   109
	require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   110
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   111
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   112
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   113
if (isset($_GET['show_users']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   114
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   115
	$ip = $_GET['show_users'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   116
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   117
	if (!@preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   118
		message('The supplied IP address is not correctly formatted.');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   119
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   120
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   121
	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   122
	require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   123
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   124
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   125
<div class="linkst">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   126
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   127
		<div><a href="javascript:history.go(-1)">Go back</a></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   128
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   129
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   130
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   131
<div id="users2" class="blocktable">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   132
	<h2><span>Users</span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   133
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   134
		<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   135
			<table cellspacing="0">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   136
			<thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   137
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   138
					<th class="tcl" scope="col">Username</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   139
					<th class="tc2" scope="col">E-mail</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   140
					<th class="tc3" scope="col">Title/Status</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   141
					<th class="tc4" scope="col">Posts</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   142
					<th class="tc5" scope="col">Admin note</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   143
					<th class="tcr" scope="col">Actions</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   144
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   145
			</thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   146
			<tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   147
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   148
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   149
	$result = $pun_db->query('SELECT DISTINCT poster_id, poster FROM '.$pun_db->prefix.'posts WHERE poster_ip=\''.$pun_db->escape($ip).'\' ORDER BY poster DESC') or error('Unable to fetch post info', __FILE__, __LINE__, $pun_db->error());
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   150
	$num_posts = $pun_db->num_rows($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   151
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   152
	if ($num_posts)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   153
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   154
		// Loop through users and print out some info
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   155
		for ($i = 0; $i < $num_posts; ++$i)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   156
		{
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   157
			list($poster_id, $poster) = $pun_db->fetch_row($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   158
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   159
			$result2 = $pun_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 '.$pun_db->prefix.'users AS u INNER JOIN '.$pun_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__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   160
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   161
			if (($user_data = $pun_db->fetch_assoc($result2)))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   162
			{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   163
				$user_title = get_title($user_data);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   164
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   165
				$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Show posts</a>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   166
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   167
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   168
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   169
					<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   170
					<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   171
					<td class="tc3"><?php echo $user_title ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   172
					<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   173
					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&nbsp;' ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   174
					<td class="tcr"><?php echo $actions ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   175
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   176
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   177
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   178
			}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   179
			else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   180
			{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   181
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   182
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   183
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   184
					<td class="tcl"><?php echo pun_htmlspecialchars($poster) ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   185
					<td class="tc2">&nbsp;</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   186
					<td class="tc3">Guest</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   187
					<td class="tc4">&nbsp;</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   188
					<td class="tc5">&nbsp;</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   189
					<td class="tcr">&nbsp;</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   190
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   191
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   192
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   193
			}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   194
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   195
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   196
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   197
		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">The supplied IP address could not be found in the database.</td></tr>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   198
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   199
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   200
			</tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   201
			</table>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   202
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   203
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   204
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   205
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   206
<div class="linksb">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   207
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   208
		<div><a href="javascript:history.go(-1)">Go back</a></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   209
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   210
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   211
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   212
	require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   213
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   214
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   215
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   216
else if (isset($_POST['find_user']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   217
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   218
	$form = $_POST['form'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   219
	$form['username'] = $_POST['username'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   220
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   221
	// trim() all elements in $form
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   222
	$form = array_map('trim', $form);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   223
	$conditions = array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   224
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   225
	$posts_greater = trim($_POST['posts_greater']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   226
	$posts_less = trim($_POST['posts_less']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   227
	$last_post_after = trim($_POST['last_post_after']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   228
	$last_post_before = trim($_POST['last_post_before']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   229
	$registered_after = trim($_POST['registered_after']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   230
	$registered_before = trim($_POST['registered_before']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   231
	$order_by = $_POST['order_by'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   232
	$direction = $_POST['direction'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   233
	$user_group = $_POST['user_group'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   234
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   235
	if (preg_match('/[^0-9]/', $posts_greater.$posts_less))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   236
		message('You entered a non-numeric value into a numeric only column.');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   237
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   238
	// Try to convert date/time to timestamps
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   239
	if ($last_post_after != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   240
		$last_post_after = strtotime($last_post_after);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   241
	if ($last_post_before != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   242
		$last_post_before = strtotime($last_post_before);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   243
	if ($registered_after != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   244
		$registered_after = strtotime($registered_after);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   245
	if ($registered_before != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   246
		$registered_before = strtotime($registered_before);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   247
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   248
	if ($last_post_after == -1 || $last_post_before == -1 || $registered_after == -1 || $registered_before == -1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   249
		message('You entered an invalid date/time.');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   250
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   251
	if ($last_post_after != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   252
		$conditions[] = 'u.last_post>'.$last_post_after;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   253
	if ($last_post_before != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   254
		$conditions[] = 'u.last_post<'.$last_post_before;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   255
	if ($registered_after != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   256
		$conditions[] = 'u.registered>'.$registered_after;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   257
	if ($registered_before != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   258
		$conditions[] = 'u.registered<'.$registered_before;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   259
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   260
	$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   261
	while (list($key, $input) = @each($form))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   262
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   263
		if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note')))
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   264
			$conditions[] = 'u.'.$pun_db->escape($key).' '.$like_command.' \''.$pun_db->escape(str_replace('*', '%', $input)).'\'';
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   265
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   266
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   267
	if ($posts_greater != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   268
		$conditions[] = 'u.num_posts>'.$posts_greater;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   269
	if ($posts_less != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   270
		$conditions[] = 'u.num_posts<'.$posts_less;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   271
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   272
	if ($user_group != 'all')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   273
		$conditions[] = 'u.group_id='.intval($user_group);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   274
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   275
	if (empty($conditions))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   276
		message('You didn\'t enter any search terms.');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   277
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   278
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   279
	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   280
	require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   281
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   282
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   283
<div class="linkst">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   284
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   285
		<div><a href="javascript:history.go(-1)">Go back</a></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   286
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   287
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   288
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   289
<div id="users2" class="blocktable">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   290
	<h2><span>Users</span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   291
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   292
		<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   293
			<table cellspacing="0">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   294
			<thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   295
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   296
					<th class="tcl" scope="col">Username</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   297
					<th class="tc2" scope="col">E-mail</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   298
					<th class="tc3" scope="col">Title/Status</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   299
					<th class="tc4" scope="col">Posts</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   300
					<th class="tc5" scope="col">Admin note</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   301
					<th class="tcr" scope="col">Actions</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   302
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   303
			</thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   304
			<tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   305
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   306
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   307
	$result = $pun_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 '.$pun_db->prefix.'users AS u LEFT JOIN '.$pun_db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$pun_db->escape($order_by).' '.$pun_db->escape($direction)) or error('Unable to fetch user info', __FILE__, __LINE__, $pun_db->error());
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   308
	if ($pun_db->num_rows($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   309
	{
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   310
		while ($user_data = $pun_db->fetch_assoc($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   311
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   312
			$user_title = get_title($user_data);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   313
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   314
			// This script is a special case in that we want to display "Not verified" for non-verified users
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   315
			if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   316
				$user_title = '<span class="warntext">Not verified</span>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   317
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   318
			$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Show posts</a>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   319
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   320
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   321
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   322
					<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   323
					<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   324
					<td class="tc3"><?php echo $user_title ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   325
					<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   326
					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&nbsp;' ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   327
					<td class="tcr"><?php echo $actions ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   328
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   329
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   330
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   331
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   332
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   333
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   334
		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">No match.</td></tr>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   335
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   336
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   337
			</tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   338
			</table>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   339
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   340
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   341
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   342
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   343
<div class="linksb">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   344
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   345
		<div><a href="javascript:history.go(-1)">Go back</a></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   346
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   347
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   348
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   349
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   350
	require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   351
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   352
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   353
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   354
else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   355
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   356
	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Users';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   357
	$focus_element = array('find_user', 'username');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   358
	require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   359
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   360
	generate_admin_menu('users');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   361
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   362
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   363
	<div class="blockform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   364
		<h2><span>User search</span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   365
		<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   366
			<form id="find_user" method="post" action="admin_users.php?action=find_user">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   367
				<p class="submittop"><input type="submit" name="find_user" value="Submit search" tabindex="1" /></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   368
				<div class="inform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   369
					<fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   370
						<legend>Enter search criteria</legend>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   371
						<div class="infldset">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   372
							<p>Search for users in the database. You can enter one or more terms to search for. Wildcards in the form of asterisks (*) are accepted.</p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   373
							<table  class="aligntop" cellspacing="0">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   374
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   375
									<th scope="row">Username</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   376
									<td><input type="text" name="username" size="25" maxlength="25" tabindex="2" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   377
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   378
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   379
									<th scope="row">E-mail address</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   380
									<td><input type="text" name="form[email]" size="30" maxlength="50" tabindex="3" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   381
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   382
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   383
									<th scope="row">Title</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   384
									<td><input type="text" name="form[title]" size="30" maxlength="50" tabindex="4" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   385
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   386
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   387
									<th scope="row">Real name</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   388
									<td><input type="text" name="form[realname]" size="30" maxlength="40" tabindex="5" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   389
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   390
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   391
									<th scope="row">Website</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   392
									<td><input type="text" name="form[url]" size="35" maxlength="100" tabindex="6" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   393
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   394
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   395
									<th scope="row">ICQ</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   396
									<td><input type="text" name="form[icq]" size="12" maxlength="12" tabindex="7" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   397
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   398
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   399
									<th scope="row">MSN Messenger</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   400
									<td><input type="text" name="form[msn]" size="30" maxlength="50" tabindex="8" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   401
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   402
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   403
									<th scope="row">AOL IM</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   404
									<td><input type="text" name="form[aim]" size="20" maxlength="20" tabindex="9" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   405
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   406
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   407
									<th scope="row">Yahoo! Messenger</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   408
									<td><input type="text" name="form[yahoo]" size="20" maxlength="20" tabindex="10" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   409
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   410
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   411
									<th scope="row">Location</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   412
									<td><input type="text" name="form[location]" size="30" maxlength="30" tabindex="11" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   413
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   414
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   415
									<th scope="row">Signature</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   416
									<td><input type="text" name="form[signature]" size="35" maxlength="512" tabindex="12" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   417
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   418
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   419
									<th scope="row">Admin note</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   420
									<td><input type="text" name="form[admin_note]" size="30" maxlength="30" tabindex="13" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   421
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   422
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   423
									<th scope="row">Number of posts greater than</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   424
									<td><input type="text" name="posts_greater" size="5" maxlength="8" tabindex="14" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   425
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   426
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   427
									<th scope="row">Number of posts less than</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   428
									<td><input type="text" name="posts_less" size="5" maxlength="8" tabindex="15" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   429
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   430
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   431
									<th scope="row">Last post is after</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   432
									<td><input type="text" name="last_post_after" size="24" maxlength="19" tabindex="16" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   433
									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   434
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   435
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   436
									<th scope="row">Last post is before</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   437
									<td><input type="text" name="last_post_before" size="24" maxlength="19" tabindex="17" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   438
									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   439
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   440
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   441
									<th scope="row">Registered after</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   442
									<td><input type="text" name="registered_after" size="24" maxlength="19" tabindex="18" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   443
									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   444
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   445
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   446
									<th scope="row">Registered before</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   447
									<td><input type="text" name="registered_before" size="24" maxlength="19" tabindex="19" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   448
									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   449
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   450
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   451
									<th scope="row">Order by</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   452
									<td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   453
										<select name="order_by" tabindex="20">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   454
											<option value="username" selected="selected">username</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   455
											<option value="email">e-mail</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   456
											<option value="num_posts">posts</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   457
											<option value="last_post">last post</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   458
											<option value="registered">registered</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   459
										</select>&nbsp;&nbsp;&nbsp;<select name="direction" tabindex="21">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   460
											<option value="ASC" selected="selected">ascending</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   461
											<option value="DESC">descending</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   462
										</select>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   463
									</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   464
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   465
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   466
									<th scope="row">User group</th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   467
									<td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   468
										<select name="user_group" tabindex="22">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   469
												<option value="all" selected="selected">All groups</option>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   470
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   471
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   472
	$result = $pun_db->query('SELECT g_id, g_title FROM '.$pun_db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   473
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   474
	while ($cur_group = $pun_db->fetch_assoc($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   475
		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   476
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   477
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   478
										</select>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   479
									</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   480
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   481
							</table>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   482
						</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   483
					</fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   484
				</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   485
				<p class="submitend"><input type="submit" name="find_user" value="Submit search" tabindex="23" /></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   486
			</form>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   487
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   488
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   489
		<h2 class="block2"><span>IP search</span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   490
		<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   491
			<form method="get" action="admin_users.php">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   492
				<div class="inform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   493
					<fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   494
						<legend>Enter IP to search for</legend>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   495
						<div class="infldset">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   496
							<table class="aligntop" cellspacing="0">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   497
								<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   498
									<th scope="row">IP address<div><input type="submit" value=" Find " tabindex="25" /></div></th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   499
									<td><input type="text" name="show_users" size="18" maxlength="15" tabindex="24" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   500
									<span>The IP address to search for in the post database.</span></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   501
								</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   502
							</table>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   503
						</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   504
					</fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   505
				</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   506
			</form>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   507
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   508
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   509
	<div class="clearer"></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   510
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   511
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   512
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   513
	require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   514
}