punbb/admin/users.php
author Dan
Sat, 05 Apr 2008 23:56:45 -0400
changeset 6 5e1f1e916419
child 7 98bbc533541c
permissions -rw-r--r--
Big upgrade to 1.3 beta. Basic things are working.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     1
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     2
/***********************************************************************
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     3
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     4
  Copyright (C) 2002-2008  PunBB.org
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     5
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     6
  This file is part of PunBB.
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     7
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     8
  PunBB is free software; you can redistribute it and/or modify it
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     9
  under the terms of the GNU General Public License as published
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    10
  by the Free Software Foundation; either version 2 of the License,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    11
  or (at your option) any later version.
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    12
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    13
  PunBB is distributed in the hope that it will be useful, but
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    14
  WITHOUT ANY WARRANTY; without even the implied warranty of
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    16
  GNU General Public License for more details.
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    17
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    18
  You should have received a copy of the GNU General Public License
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    19
  along with this program; if not, write to the Free Software
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    20
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    21
  MA  02111-1307  USA
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    22
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    23
************************************************************************/
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    24
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    25
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    26
// if (!defined('PUN_ROOT'))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    27
// 	define('PUN_ROOT', '../');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    28
// require PUN_ROOT.'include/common.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    29
require PUN_ROOT.'include/common_admin.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    30
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    31
// import globals (I really hope this isn't dangerous)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    32
foreach ( $GLOBALS as $key => $_ )
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    33
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    34
  $$key =& $GLOBALS[$key];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    35
}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    36
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    37
($hook = get_hook('aus_start')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    38
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    39
if (!$pun_user['is_admmod'])
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    40
	message($lang_common['No permission']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    41
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    42
// Load the admin.php language file
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    43
require PUN_ROOT.'lang/'.$pun_user['language'].'/admin.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    44
$GLOBALS['lang_admin'] = $lang_admin;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    45
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    46
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    47
// Show IP statistics for a certain user ID
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    48
if (isset($_GET['ip_stats']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    49
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    50
	$ip_stats = intval($_GET['ip_stats']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    51
	if ($ip_stats < 1)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    52
		message($lang_common['Bad request']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    53
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    54
	($hook = get_hook('aus_ip_stats_selected')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    55
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    56
	$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    57
		'SELECT'	=> 'p.poster_ip, MAX(p.posted) AS last_used, COUNT(p.id) AS used_times',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    58
		'FROM'		=> 'posts AS p',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    59
		'WHERE'		=> 'p.poster_id='.$ip_stats,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    60
		'GROUP BY'	=> 'p.poster_ip',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    61
		'ORDER BY'	=> 'last_used DESC'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    62
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    63
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    64
	($hook = get_hook('aus_qr_get_user_ips')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    65
	$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    66
	$pun_page['num_users'] = $pun_db->num_rows($result);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    67
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    68
	// Setup breadcrumbs
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    69
	$pun_page['crumbs'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    70
		array($pun_config['o_board_title'], pun_link($pun_url['index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    71
		array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    72
		array($lang_admin['Searches'], pun_link($pun_url['admin_users'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    73
		$lang_admin['User search results']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    74
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    75
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    76
	($hook = get_hook('aus_ip_stats_pre_header_load')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    77
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    78
	define('PUN_PAGE_SECTION', 'users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    79
	define('PUN_PAGE', 'admin-users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    80
	require PUN_ROOT.'header.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    81
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    82
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    83
<div id="pun-main" class="main sectioned admin">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    84
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    85
<?php echo generate_admin_menu(); ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    86
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    87
	<div class="main-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    88
		<h1><span>{ <?php echo end($pun_page['crumbs']) ?> }</span></h1>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    89
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    90
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    91
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    92
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    93
			<h2><span><?php printf($lang_admin['IP addresses found'], $pun_page['num_users']) ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    94
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    95
		<div class="frm-form">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    96
			<table cellspacing="0">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    97
				<thead>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    98
					<tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    99
						<th class="tcl" scope="col"><?php echo $lang_admin['IP address'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   100
						<th class="tc2" scope="col"><?php echo $lang_admin['Last used'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   101
						<th class="tc3" scope="col"><?php echo $lang_admin['Times found'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   102
<?php ($hook = get_hook('aus_ip_stats_table_header_after_used_times')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   103
						<th class="tcr" scope="col"><?php echo $lang_admin['Actions'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   104
<?php ($hook = get_hook('aus_ip_stats_table_header_after_actions')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   105
					</tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   106
				</thead>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   107
				<tbody>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   108
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   109
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   110
	if ($pun_page['num_users'])
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   111
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   112
		while ($cur_ip = $pun_db->fetch_assoc($result))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   113
		{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   114
			$pun_page['actions'] = '<a href="'.pun_link($pun_url['admin_users']).'&show_users='.$cur_ip['poster_ip'].'">'.$lang_admin['Find more users'].'</a>';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   115
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   116
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   117
					<tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   118
						<td class="tcl"><a href="<?php echo pun_link($pun_url['get_host'], $cur_ip['poster_ip']) ?>"><?php echo $cur_ip['poster_ip'] ?></a></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   119
						<td class="tc2"><?php echo format_time($cur_ip['last_used']) ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   120
						<td class="tc3"><?php echo $cur_ip['used_times'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   121
<?php ($hook = get_hook('aus_ip_stats_table_contents_after_used_times')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   122
						<td class="tcr actions"><?php echo $pun_page['actions'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   123
<?php ($hook = get_hook('aus_ip_stats_table_contents_after_actions')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   124
					</tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   125
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   126
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   127
		}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   128
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   129
	else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   130
		echo "\t\t\t\t\t\t".'<tr><td class="tcl" colspan="4">'.$lang_admin['No posts by user'].'</td></tr>'."\n";
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   131
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   132
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   133
				</tbody>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   134
			</table>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   135
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   136
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   137
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   138
</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   139
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   140
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   141
	require PUN_ROOT.'footer.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   142
}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   143
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   144
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   145
// Show users that have at one time posted with the specified IP address
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   146
else if (isset($_GET['show_users']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   147
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   148
	$ip = $_GET['show_users'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   149
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   150
	if (!@preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   151
		message('The supplied IP address is not correctly formatted.');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   152
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   153
	($hook = get_hook('aus_show_users_selected')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   154
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   155
	// Load the misc.php language file
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   156
	require PUN_ROOT.'lang/'.$pun_user['language'].'/misc.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   157
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   158
	$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   159
		'SELECT'	=> 'DISTINCT p.poster_id, p.poster',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   160
		'FROM'		=> 'posts AS p',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   161
		'WHERE'		=> 'p.poster_ip=\''.$pun_db->escape($ip).'\'',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   162
		'ORDER BY'	=> 'p.poster DESC'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   163
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   164
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   165
	($hook = get_hook('aus_qr_get_users_matching_ip')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   166
	$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   167
	$pun_page['num_users'] = $pun_db->num_rows($result);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   168
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   169
	// Setup breadcrumbs
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   170
	$pun_page['crumbs'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   171
		array($pun_config['o_board_title'], pun_link($pun_url['index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   172
		array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   173
		array($lang_admin['Searches'], pun_link($pun_url['admin_users'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   174
		$lang_admin['User search results']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   175
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   176
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   177
	($hook = get_hook('aus_show_users_pre_header_load')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   178
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   179
	define('PUN_PAGE_SECTION', 'users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   180
	define('PUN_PAGE', 'admin-users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   181
	require PUN_ROOT.'header.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   182
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   183
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   184
<div id="pun-main" class="main sectioned admin">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   185
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   186
<?php echo generate_admin_menu(); ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   187
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   188
	<div class="main-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   189
		<h1><span>{ <?php echo end($pun_page['crumbs']) ?> }</span></h1>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   190
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   191
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   192
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   193
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   194
			<h2><span><?php printf($lang_admin['Users found'], $pun_page['num_users']) ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   195
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   196
		<form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo pun_link($pun_url['admin_users']) ?>&amp;action=modify_users">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   197
			<div class="hidden">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   198
				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token(pun_link($pun_url['admin_users']).'&action=modify_users') ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   199
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   200
			<table cellspacing="0">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   201
				<thead>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   202
					<tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   203
						<th class="tcl" scope="col"><?php echo $lang_admin['Username column'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   204
						<th class="tc2" scope="col"><?php echo $lang_admin['Title column'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   205
						<th class="tc3" scope="col"><?php echo $lang_admin['Posts'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   206
<?php ($hook = get_hook('aus_show_users_table_header_after_num_posts')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   207
						<th class="tcr actions" scope="col"><?php echo $lang_admin['Actions'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   208
<?php ($hook = get_hook('aus_show_users_table_header_after_actions')) ? eval($hook) : null; if ($pun_user['g_id'] == PUN_ADMIN): ?>						<th class="tcmod" scope="col"><?php echo $lang_misc['Select'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   209
<?php endif; ?>					</tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   210
				</thead>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   211
				<tbody>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   212
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   213
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   214
	$num_posts = $pun_db->num_rows($result);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   215
	if ($num_posts)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   216
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   217
		// Loop through users and print out some info
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   218
		for ($i = 0; $i < $num_posts; ++$i)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   219
		{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   220
			list($poster_id, $poster) = $pun_db->fetch_row($result);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   221
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   222
			$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   223
				'SELECT'	=> 'u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   224
				'FROM'		=> 'users AS u',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   225
				'JOINS'		=> array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   226
					array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   227
						'INNER JOIN'	=> 'groups AS g',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   228
						'ON'			=> 'g.g_id=u.group_id'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   229
					)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   230
				),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   231
				'WHERE'		=> 'u.id>1 AND u.id='.$poster_id
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   232
			);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   233
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   234
			($hook = get_hook('aus_qr_get_user_details')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   235
			$result2 = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   236
			if ($user_data = $pun_db->fetch_assoc($result2))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   237
			{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   238
				$pun_page['user_title'] = get_title($user_data);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   239
				$pun_page['actions'] = '<span><a href="'.pun_link($pun_url['admin_users']).'&ip_stats='.$user_data['id'].'">'.$lang_admin['View IP stats'].'</a></span> <span><a href="'.pun_link($pun_url['search_user_posts'], $user_data['id']).'">'.$lang_admin['Show posts'].'</a></span>';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   240
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   241
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   242
					<tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   243
						<td class="tcl"><strong><a href="<?php echo pun_link($pun_url['user'], $user_data['id']) ?>"><?php echo htmlspecialchars($user_data['username']) ?></a></strong> <span class="usermail"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></span> <?php if ($user_data['admin_note'] != '') echo '<span class="usernote">'.htmlspecialchars($user_data['admin_note']).'</span>' ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   244
						<td class="tc2"><?php echo $pun_page['user_title'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   245
						<td class="tc3"><?php echo $user_data['num_posts'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   246
<?php ($hook = get_hook('aus_show_users_table_contents_after_num_posts')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   247
						<td class="tcr actions"><?php echo $pun_page['actions'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   248
<?php ($hook = get_hook('aus_show_users_table_contents_after_actions')) ? eval($hook) : null; if ($pun_user['g_id'] == PUN_ADMIN): ?>						<td class="tcmod"><input type="checkbox" name="users[<?php echo $user_data['id'] ?>]" value="1" /></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   249
<?php endif; ?>					</tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   250
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   251
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   252
			}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   253
			else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   254
			{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   255
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   256
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   257
					<tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   258
						<td class="tcl"><?php echo htmlspecialchars($poster) ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   259
						<td class="tc2"><?php echo $lang_admin['Guest'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   260
						<td class="tc3">&#160;</td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   261
<?php ($hook = get_hook('aus_show_users_table_contents_after_num_posts_guest')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   262
						<td class="tcr">&#160;</td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   263
<?php ($hook = get_hook('aus_show_users_table_contents_after_actions_guest')) ? eval($hook) : null; if ($pun_user['g_id'] == PUN_ADMIN): ?>						<td class="tcmod">&#160;</td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   264
<?php endif; ?>					</tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   265
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   266
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   267
			}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   268
		}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   269
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   270
	else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   271
		echo "\t\t\t\t\t".'<tr><td class="tcl" colspan="'.(($pun_user['g_id'] == PUN_ADMIN) ? '5' : '4').'">'.$lang_admin['Cannot find IP'].'</td></tr>'."\n";
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   272
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   273
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   274
				</tbody>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   275
			</table>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   276
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   277
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   278
// Setup control buttons
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   279
$pun_page['main_submit'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   280
	'<span class="submit"><input type="submit" name="ban_users" value="'.$lang_admin['Ban'].'" /></span>',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   281
	'<span class="submit"><input type="submit" name="delete_users" value="'.$lang_admin['Delete'].'" /></span>',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   282
	'<span class="submit"><input type="submit" name="change_group" value="'.$lang_admin['Change group'].'" /></span>'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   283
);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   284
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   285
($hook = get_hook('aus_show_users_pre_moderation_buttons')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   286
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   287
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   288
			<p class="submitting"><?php echo implode("\n\t\t\t", $pun_page['main_submit'])."\n" ?></p>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   289
		</form>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   290
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   291
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   292
</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   293
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   294
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   295
	require PUN_ROOT.'footer.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   296
}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   297
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   298
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   299
else if (isset($_POST['delete_users']) || isset($_POST['delete_users_comply']) || isset($_POST['delete_users_cancel']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   300
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   301
	// User pressed the cancel button
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   302
	if (isset($_POST['delete_users_cancel']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   303
		pun_redirect(pun_link($pun_url['admin_users']), $lang_common['Cancel redirect']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   304
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   305
	if ($session->user_level < USER_LEVEL_ADMIN)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   306
		message($lang_common['No permission']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   307
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   308
	if (empty($_POST['users']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   309
		message($lang_admin['No users selected']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   310
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   311
	($hook = get_hook('aus_delete_users_selected')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   312
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   313
	if (!is_array($_POST['users']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   314
		$users = explode(',', $_POST['users']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   315
	else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   316
		$users = array_keys($_POST['users']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   317
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   318
	$users = array_map('intval', $users);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   319
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   320
	// We check to make sure there are no administrators in this list
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   321
	$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   322
		'SELECT'	=> '1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   323
		'FROM'		=> 'users AS u',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   324
		'WHERE'		=> 'u.id IN ('.implode(',', $users).') AND u.group_id='.PUN_ADMIN
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   325
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   326
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   327
	($hook = get_hook('aus_qr_check_for_admins')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   328
	$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   329
	if ($pun_db->num_rows($result) > 0)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   330
		message($lang_admin['Delete admin message']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   331
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   332
	if (isset($_POST['delete_users_comply']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   333
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   334
		($hook = get_hook('aus_delete_users_form_submitted')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   335
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   336
		foreach ($users as $id)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   337
		{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   338
			// We don't want to delete the Guest user
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   339
			if ($id > 1)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   340
				delete_user($id, true);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   341
		}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   342
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   343
		pun_redirect(pun_link($pun_url['admin_users']), $lang_admin['Users deleted'].' '.$lang_admin['Redirect']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   344
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   345
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   346
	// Setup form
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   347
	$pun_page['set_count'] = $pun_page['fld_count'] = 0;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   348
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   349
	// Setup breadcrumbs
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   350
	$pun_page['crumbs'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   351
		array($pun_config['o_board_title'], pun_link($pun_url['index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   352
		array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   353
		array($lang_admin['Searches'], pun_link($pun_url['admin_users'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   354
		$lang_admin['Delete users']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   355
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   356
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   357
	($hook = get_hook('aus_delete_users_pre_header_load')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   358
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   359
	define('PUN_PAGE_SECTION', 'users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   360
	define('PUN_PAGE', 'admin-users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   361
	require PUN_ROOT.'header.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   362
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   363
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   364
<div id="pun-main" class="main sectioned admin">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   365
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   366
<?php echo generate_admin_menu(); ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   367
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   368
	<div class="main-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   369
		<h1><span>{ <?php echo end($pun_page['crumbs']) ?> }</span></h1>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   370
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   371
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   372
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   373
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   374
			<h2><span><?php echo $lang_admin['Confirm delete'] ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   375
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   376
		<div class="frm-info">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   377
			<p class="warn"><?php echo $lang_admin['Delete warning'] ?></p>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   378
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   379
		<form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo pun_link($pun_url['admin_users']) ?>&amp;action=modify_users">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   380
			<div class="hidden">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   381
				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token(pun_link($pun_url['admin_users']).'&action=modify_users') ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   382
				<input type="hidden" name="users" value="<?php echo implode(',', $users) ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   383
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   384
			<fieldset class="frm-set set<?php echo ++$pun_page['set_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   385
				<legend class="frm-legend"><span><?php echo $lang_admin['Delete posts legend'] ?></span></legend>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   386
				<div class="radbox checkbox">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   387
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>"><span class="fld-label"><?php echo $lang_admin['Delete posts'] ?></span><br /><input type="checkbox" id="fld<?php echo ++$fld_count ?>" name="delete_posts" value="1" checked="checked" /> <?php echo $lang_admin['Delete posts label'] ?></label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   388
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   389
			</fieldset>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   390
			<div class="frm-buttons">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   391
				<span class="submit"><input type="submit" name="delete_users_comply" value="<?php echo $lang_admin['Delete'] ?>" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   392
				<span class="cancel"><input type="submit" name="delete_users_cancel" value="<?php echo $lang_common['Cancel'] ?>" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   393
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   394
		</form>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   395
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   396
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   397
</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   398
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   399
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   400
	require PUN_ROOT.'footer.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   401
}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   402
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   403
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   404
else if (isset($_POST['ban_users']) || isset($_POST['ban_users_comply']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   405
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   406
	if ($session->user_level < USER_LEVEL_ADMIN)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   407
		message($lang_common['No permission']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   408
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   409
	if (empty($_POST['users']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   410
		message($lang_admin['No users selected']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   411
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   412
	($hook = get_hook('aus_ban_users_selected')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   413
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   414
	if (!is_array($_POST['users']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   415
		$users = explode(',', $_POST['users']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   416
	else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   417
		$users = array_keys($_POST['users']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   418
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   419
	$users = array_map('intval', $users);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   420
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   421
	// We check to make sure there are no administrators in this list
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   422
	$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   423
		'SELECT'	=> '1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   424
		'FROM'		=> 'users AS u',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   425
		'WHERE'		=> 'u.id IN ('.implode(',', $users).') AND u.group_id='.PUN_ADMIN
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   426
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   427
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   428
	($hook = get_hook('aus_qr_check_for_admins2')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   429
	$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   430
	if ($pun_db->num_rows($result) > 0)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   431
		message($lang_admin['Ban admin message']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   432
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   433
	if (isset($_POST['ban_users_comply']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   434
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   435
		$ban_message = trim($_POST['ban_message']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   436
		$ban_expire = trim($_POST['ban_expire']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   437
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   438
		($hook = get_hook('aus_ban_users_form_submitted')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   439
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   440
		if ($ban_expire != '' && $ban_expire != 'Never')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   441
		{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   442
			$ban_expire = strtotime($ban_expire);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   443
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   444
			if ($ban_expire == -1 || $ban_expire <= time())
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   445
				message($lang_admin['Invalid expire message']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   446
		}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   447
		else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   448
			$ban_expire = 'NULL';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   449
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   450
		$ban_message = ($ban_message != '') ? '"'.$pun_db->escape($ban_message).'"' : 'NULL';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   451
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   452
		// Get the latest IPs for the posters and store them for a little later
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   453
		$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   454
			'SELECT'	=> 'p.poster_id, p.poster_ip',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   455
			'FROM'		=> 'posts AS p',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   456
			'WHERE'		=> 'p.poster_id IN ('.implode(',', $users).') AND p.poster_id>1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   457
			'GROUP BY'	=> 'p.poster_id',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   458
			'ORDER BY'	=> 'p.posted DESC'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   459
		);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   460
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   461
		($hook = get_hook('aus_qr_get_latest_user_ips')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   462
		$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   463
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   464
		$ips = array();
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   465
		while ($cur_post = $pun_db->fetch_assoc($result))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   466
			$ips[$cur_post['poster_id']] = $cur_post['poster_ip'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   467
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   468
		// Get the rest of the data for the posters, merge in the IP information, create a ban
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   469
		$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   470
			'SELECT'	=> 'u.id, u.username, u.email, u.registration_ip',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   471
			'FROM'		=> 'users AS u',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   472
			'WHERE'		=> 'id IN ('.implode(',', $users).') AND id>1'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   473
		);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   474
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   475
		($hook = get_hook('aus_qr_get_users')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   476
		$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   477
		while ($cur_user = $pun_db->fetch_assoc($result))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   478
		{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   479
			$ban_ip = isset($ips[$cur_user['id']]) ? $ips[$cur_user['id']] : $cur_user['registration_ip'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   480
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   481
			$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   482
				'INSERT'	=> 'username, ip, email, message, expire, ban_creator',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   483
				'INTO'		=> 'bans',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   484
				'VALUES'	=> '\''.$pun_db->escape($cur_user['username']).'\', \''.$ban_ip.'\', \''.$pun_db->escape($cur_user['email']).'\', '.$ban_message.', '.$ban_expire.', '.$pun_user['id']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   485
			);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   486
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   487
			($hook = get_hook('aus_qr_add_ban')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   488
			$pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   489
		}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   490
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   491
		// Regenerate the bans cache
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   492
		require_once PUN_ROOT.'include/cache.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   493
		generate_bans_cache();
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   494
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   495
		pun_redirect(pun_link($pun_url['admin_users']), $lang_admin['Users banned'].' '.$lang_admin['Redirect']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   496
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   497
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   498
	// Setup form
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   499
	$pun_page['set_count'] = $pun_page['fld_count'] = 0;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   500
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   501
	// Setup breadcrumbs
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   502
	$pun_page['crumbs'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   503
		array($pun_config['o_board_title'], pun_link($pun_url['index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   504
		array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   505
		array($lang_admin['Searches'], pun_link($pun_url['admin_users'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   506
		$lang_admin['Ban users']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   507
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   508
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   509
	($hook = get_hook('aus_ban_users_pre_header_load')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   510
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   511
	define('PUN_PAGE_SECTION', 'users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   512
	define('PUN_PAGE', 'admin-users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   513
	require PUN_ROOT.'header.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   514
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   515
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   516
<div id="pun-main" class="main sectioned admin">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   517
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   518
<?php echo generate_admin_menu(); ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   519
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   520
	<div class="main-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   521
		<h1><span>{ <?php echo end($pun_page['crumbs']) ?> }</span></h1>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   522
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   523
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   524
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   525
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   526
			<h2><span><?php echo $lang_admin['Ban advanced heading'] ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   527
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   528
		<div class="frm-info">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   529
			<p><?php echo $lang_admin['Mass ban info'] ?></p>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   530
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   531
		<form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo pun_link($pun_url['admin_users']) ?>&amp;action=modify_users">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   532
			<div class="hidden">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   533
				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token(pun_link($pun_url['admin_users']).'&action=modify_users') ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   534
				<input type="hidden" name="users" value="<?php echo implode(',', $users) ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   535
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   536
			<fieldset class="frm-set set<?php echo ++$pun_page['set_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   537
				<legend class="frm-legend"><span><?php echo $lang_admin['Ban settings legend'] ?></span></legend>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   538
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   539
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   540
						<span class="fld-label"><?php echo $lang_admin['Ban message'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   541
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="ban_message" size="50" maxlength="255" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   542
						<span class="fld-help"><?php echo $lang_admin['Ban message info'] ?></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   543
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   544
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   545
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   546
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   547
						<span class="fld-label"><?php echo $lang_admin['Expire date'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   548
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="ban_expire" size="17" maxlength="10" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   549
						<span class="fld-help"><?php echo $lang_admin['Expire date info'] ?></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   550
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   551
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   552
			</fieldset>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   553
			<div class="frm-buttons">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   554
				<span class="submit"><input type="submit" class="button" name="ban_users_comply" value="<?php echo $lang_admin['Ban'] ?>" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   555
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   556
		</form>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   557
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   558
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   559
</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   560
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   561
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   562
	require PUN_ROOT.'footer.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   563
}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   564
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   565
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   566
else if (isset($_POST['change_group']) || isset($_POST['change_group_comply']) || isset($_POST['change_group_cancel']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   567
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   568
	if ($session->user_level < USER_LEVEL_ADMIN)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   569
		message($lang_common['No permission']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   570
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   571
	// User pressed the cancel button
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   572
	if (isset($_POST['change_group_cancel']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   573
		pun_redirect(pun_link($pun_url['admin_users']), $lang_admin['Cancel redirect']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   574
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   575
	if (empty($_POST['users']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   576
		message($lang_admin['No users selected']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   577
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   578
	($hook = get_hook('aus_change_group_selected')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   579
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   580
	if (!is_array($_POST['users']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   581
		$users = explode(',', $_POST['users']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   582
	else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   583
		$users = array_keys($_POST['users']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   584
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   585
	$users = array_map('intval', $users);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   586
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   587
	if (isset($_POST['change_group_comply']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   588
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   589
		$move_to_group = intval($_POST['move_to_group']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   590
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   591
		($hook = get_hook('aus_change_group_form_submitted')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   592
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   593
		// We need some information on the group
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   594
		$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   595
			'SELECT'	=> 'g.g_moderator',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   596
			'FROM'		=> 'groups AS g',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   597
			'WHERE'		=> 'g.g_id='.$move_to_group
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   598
		);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   599
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   600
		($hook = get_hook('aus_qr_get_group_moderator_status')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   601
		$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   602
		if ($move_to_group == PUN_GUEST || !$pun_db->num_rows($result))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   603
			message($lang_common['Bad request']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   604
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   605
		$group_is_mod = $pun_db->result($result);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   606
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   607
		// Move users
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   608
		$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   609
			'UPDATE'	=> 'users',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   610
			'SET'		=> 'group_id='.$move_to_group,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   611
			'WHERE'		=> 'id IN ('.implode(',', $users).') AND id>1'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   612
		);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   613
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   614
		($hook = get_hook('aus_qr_change_user_group')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   615
		$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   616
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   617
		if ($move_to_group != PUN_ADMIN && $group_is_mod == '0')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   618
			clean_forum_moderators();
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   619
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   620
		pun_redirect(pun_link($pun_url['admin_users']), $lang_admin['User groups updated'].' '.$lang_admin['Redirect']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   621
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   622
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   623
	// Setup form
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   624
	$pun_page['set_count'] = $pun_page['fld_count'] = 0;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   625
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   626
	// Setup breadcrumbs
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   627
	$pun_page['crumbs'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   628
		array($pun_config['o_board_title'], pun_link($pun_url['index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   629
		array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   630
		array($lang_admin['Searches'], pun_link($pun_url['admin_users'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   631
		$lang_admin['Change group']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   632
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   633
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   634
	($hook = get_hook('aus_change_group_pre_header_load')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   635
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   636
	define('PUN_PAGE_SECTION', 'users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   637
	define('PUN_PAGE', 'admin-users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   638
	require PUN_ROOT.'header.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   639
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   640
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   641
<div id="pun-main" class="main sectioned admin">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   642
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   643
<?php echo generate_admin_menu(); ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   644
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   645
	<div class="main-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   646
		<h1><span>{ <?php echo end($pun_page['crumbs']) ?> }</span></h1>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   647
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   648
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   649
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   650
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   651
			<h2><span><?php echo $lang_admin['Change group head'] ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   652
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   653
		<form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo pun_link($pun_url['admin_users']) ?>&amp;action=modify_users">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   654
			<div class="hidden">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   655
				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token(pun_link($pun_url['admin_users']).'&action=modify_users') ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   656
				<input type="hidden" name="users" value="<?php echo implode(',', $users) ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   657
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   658
			<fieldset class="frm-set set<?php echo ++$pun_page['set_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   659
				<legend class="frm-legend"><span><?php echo $lang_admin['Move users legend'] ?></span></legend>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   660
				<div class="frm-fld select">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   661
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   662
						<span class="fld-label"><?php echo $lang_admin['Move users to'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   663
						<span class="fld-input"><select id="fld<?php echo $pun_page['fld_count'] ?>" name="move_to_group">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   664
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   665
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   666
	$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   667
		'SELECT'	=> 'g.g_id, g.g_title',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   668
		'FROM'		=> 'groups AS g',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   669
		'WHERE'		=> 'g.g_id!='.PUN_GUEST,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   670
		'ORDER BY'	=> 'g.g_title'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   671
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   672
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   673
	($hook = get_hook('aus_qr_get_groups')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   674
	$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   675
	while ($cur_group = $pun_db->fetch_assoc($result))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   676
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   677
		if ($cur_group['g_id'] == PUN_MEMBER)	// Pre-select the pre-defined Members group
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   678
			echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.htmlspecialchars($cur_group['g_title']).'</option>'."\n";
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   679
		else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   680
			echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.htmlspecialchars($cur_group['g_title']).'</option>'."\n";
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   681
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   682
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   683
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   684
						</select></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   685
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   686
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   687
			</fieldset>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   688
			<div class="frm-buttons">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   689
				<span class="submit"><input type="submit" name="change_group_comply" value="<?php echo $lang_admin['Change group'] ?>" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   690
				<span class="cancel"><input type="submit" name="change_group_cancel" value="<?php echo $lang_admin['Cancel'] ?>" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   691
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   692
		</form>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   693
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   694
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   695
</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   696
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   697
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   698
	require PUN_ROOT.'footer.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   699
}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   700
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   701
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   702
else if (isset($_POST['find_user']))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   703
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   704
	$form = $_POST['form'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   705
	$form['username'] = $_POST['username'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   706
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   707
	($hook = get_hook('aus_find_user_selected')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   708
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   709
	// trim() all elements in $form
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   710
	$form = array_map('trim', $form);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   711
	$conditions = array();
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   712
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   713
	$posts_greater = trim($_POST['posts_greater']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   714
	$posts_less = trim($_POST['posts_less']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   715
	$last_post_after = trim($_POST['last_post_after']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   716
	$last_post_before = trim($_POST['last_post_before']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   717
	$registered_after = trim($_POST['registered_after']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   718
	$registered_before = trim($_POST['registered_before']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   719
	$order_by = $_POST['order_by'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   720
	$direction = $_POST['direction'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   721
	$user_group = $_POST['user_group'];
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   722
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   723
	if ((!empty($posts_greater) || !empty($posts_less)) && !ctype_digit($posts_greater.$posts_less))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   724
		message($lang_admin['Non numeric value message']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   725
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   726
	// Try to convert date/time to timestamps
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   727
	if ($last_post_after != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   728
		$last_post_after = strtotime($last_post_after);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   729
	if ($last_post_before != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   730
		$last_post_before = strtotime($last_post_before);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   731
	if ($registered_after != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   732
		$registered_after = strtotime($registered_after);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   733
	if ($registered_before != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   734
		$registered_before = strtotime($registered_before);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   735
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   736
	if ($last_post_after == -1 || $last_post_before == -1 || $registered_after == -1 || $registered_before == -1)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   737
		message($lang_admin['Invalid date/time message']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   738
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   739
	if ($last_post_after != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   740
		$conditions[] = 'u.last_post>'.$last_post_after;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   741
	if ($last_post_before != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   742
		$conditions[] = 'u.last_post<'.$last_post_before;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   743
	if ($registered_after != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   744
		$conditions[] = 'u.registered>'.$registered_after;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   745
	if ($registered_before != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   746
		$conditions[] = 'u.registered<'.$registered_before;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   747
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   748
	$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   749
	while (list($key, $input) = @each($form))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   750
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   751
		if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note')))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   752
			$conditions[] = 'u.'.$pun_db->escape($key).' '.$like_command.' \''.$pun_db->escape(str_replace('*', '%', $input)).'\'';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   753
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   754
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   755
	if ($posts_greater != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   756
		$conditions[] = 'u.num_posts>'.$posts_greater;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   757
	if ($posts_less != '')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   758
		$conditions[] = 'u.num_posts<'.$posts_less;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   759
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   760
	if ($user_group != 'all')
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   761
		$conditions[] = 'u.group_id='.intval($user_group);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   762
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   763
	if (empty($conditions))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   764
		message($lang_admin['No search terms message']);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   765
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   766
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   767
	// Load the misc.php language file
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   768
	require PUN_ROOT.'lang/'.$pun_user['language'].'/misc.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   769
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   770
	// Find any users matching the conditions
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   771
	$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   772
		'SELECT'	=> 'u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   773
		'FROM'		=> 'users AS u',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   774
		'JOINS'		=> array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   775
			array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   776
				'LEFT JOIN'		=> 'groups AS g',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   777
				'ON'			=> 'g.g_id=u.group_id'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   778
			)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   779
		),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   780
		'WHERE'		=> 'u.id>1 AND '.implode(' AND ', $conditions),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   781
		'ORDER BY'	=> $pun_db->escape($order_by).' '.$pun_db->escape($direction)
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   782
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   783
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   784
	($hook = get_hook('aus_qr_find_users')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   785
	$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   786
	$pun_page['num_users'] = $pun_db->num_rows($result);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   787
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   788
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   789
	// Setup breadcrumbs
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   790
	$pun_page['crumbs'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   791
		array($pun_config['o_board_title'], pun_link($pun_url['index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   792
		array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   793
		array($lang_admin['Searches'], pun_link($pun_url['admin_users'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   794
		$lang_admin['User search results']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   795
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   796
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   797
	($hook = get_hook('aus_find_user_pre_header_load')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   798
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   799
	define('PUN_PAGE_SECTION', 'users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   800
	define('PUN_PAGE', 'admin-users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   801
	require PUN_ROOT.'header.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   802
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   803
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   804
<div id="pun-main" class="main sectioned admin">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   805
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   806
<?php echo generate_admin_menu(); ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   807
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   808
	<div class="main-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   809
		<h1><span>{ <?php echo end($pun_page['crumbs']) ?> }</span></h1>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   810
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   811
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   812
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   813
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   814
			<h2><span><?php printf($lang_admin['Users found'], $pun_page['num_users']) ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   815
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   816
		<form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo pun_link($pun_url['admin_users']) ?>&amp;action=modify_users">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   817
			<div class="hidden">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   818
				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token(pun_link($pun_url['admin_users']).'&action=modify_users') ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   819
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   820
			<table cellspacing="0">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   821
				<thead>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   822
					<tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   823
						<th class="tcl" scope="col"><?php echo $lang_admin['Username column'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   824
						<th class="tc2" scope="col"><?php echo $lang_admin['Title column'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   825
						<th class="tc3" scope="col"><?php echo $lang_admin['Posts'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   826
<?php ($hook = get_hook('aus_find_user_table_header_after_num_posts')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   827
						<th class="tcr actions" scope="col"><?php echo $lang_admin['Actions'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   828
<?php ($hook = get_hook('aus_find_user_table_header_after_actions')) ? eval($hook) : null; if ($pun_user['g_id'] == PUN_ADMIN): ?>					<th class="tcmod" scope="col"><?php echo $lang_misc['Select'] ?></th>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   829
<?php endif; ?>					</tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   830
				</thead>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   831
				<tbody>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   832
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   833
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   834
	if ($pun_page['num_users'])
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   835
	{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   836
		while ($user_data = $pun_db->fetch_assoc($result))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   837
		{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   838
			$user_title = get_title($user_data);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   839
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   840
			// This script is a special case in that we want to display "Not verified" for non-verified users
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   841
			if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   842
				$user_title = '<strong>'.$lang_admin['Not verified'].'</strong>';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   843
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   844
			$pun_page['actions'] = '<span><a href="'.pun_link($pun_url['admin_users']).'&ip_stats='.$user_data['id'].'">'.$lang_admin['View IP stats'].'</a></span> <span><a href="'.pun_link($pun_url['search_user_posts'], $user_data['id']).'">'.$lang_admin['Show posts'].'</a></span>';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   845
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   846
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   847
					<tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   848
						<td class="tcl"><?php echo '<strong><a href="'.pun_link($pun_url['user'], $user_data['id']).'">'.htmlspecialchars($user_data['username']).'</a></strong>' ?> <span class="usermail"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></span> <?php if ($user_data['admin_note'] != '') echo '<span class="usernote">'.htmlspecialchars($user_data['admin_note']).'</span>' ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   849
						<td class="tc2"><?php echo $user_title ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   850
						<td class="tc3"><?php echo $user_data['num_posts'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   851
<?php ($hook = get_hook('aus_find_user_table_contents_after_num_posts')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   852
						<td class="tcr actions"><?php echo $pun_page['actions'] ?></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   853
<?php ($hook = get_hook('aus_find_user_table_contents_after_actions')) ? eval($hook) : null; if ($pun_user['g_id'] == PUN_ADMIN): ?>					<td class="tcmod"><input type="checkbox" name="users[<?php echo $user_data['id'] ?>]" value="1" /></td>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   854
<?php endif; ?>					</tr>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   855
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   856
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   857
		}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   858
	}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   859
	else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   860
		echo "\t\t\t\t\t".'<tr><td class="tcl" colspan="'.(($pun_user['g_id'] == PUN_ADMIN) ? '5' : '4').'">'.$lang_admin['No match'].'</td></tr>'."\n";
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   861
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   862
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   863
				</tbody>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   864
			</table>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   865
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   866
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   867
// Setup control buttons
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   868
$pun_page['main_submit'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   869
	'<span class="submit"><input type="submit" name="ban_users" value="'.$lang_admin['Ban'].'" /></span>',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   870
	'<span class="submit"><input type="submit" name="delete_users" value="'.$lang_admin['Delete'].'" /></span>',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   871
	'<span class="submit"><input type="submit" name="change_group" value="'.$lang_admin['Change group'].'" /></span>'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   872
);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   873
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   874
($hook = get_hook('aus_find_user_pre_moderation_buttons')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   875
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   876
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   877
			<p class="submitting">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   878
				<?php echo implode("\n\t\t\t\t", $pun_page['main_submit'])."\n" ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   879
			</p>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   880
		</form>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   881
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   882
</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   883
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   884
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   885
	require PUN_ROOT.'footer.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   886
}
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   887
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   888
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   889
else
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   890
{
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   891
	// Setup form
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   892
	$pun_page['set_count'] = $pun_page['fld_count'] = 0;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   893
	$pun_page['form_action'] = '';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   894
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   895
	// Setup breadcrumbs
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   896
	$pun_page['crumbs'] = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   897
		array($pun_config['o_board_title'], pun_link($pun_url['index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   898
		array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   899
		$lang_admin['Searches']
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   900
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   901
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   902
	($hook = get_hook('aus_search_form_pre_header_load')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   903
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   904
	define('PUN_PAGE_SECTION', 'users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   905
	define('PUN_PAGE', 'admin-users');
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   906
	require PUN_ROOT.'header.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   907
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   908
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   909
<div id="pun-main" class="main sectioned admin">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   910
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   911
<?php echo generate_admin_menu(); ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   912
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   913
	<div class="main-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   914
		<h1><span>{ <?php echo end($pun_page['crumbs']) ?> }</span></h1>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   915
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   916
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   917
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   918
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   919
			<h2><span><?php echo $lang_admin['User search head'] ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   920
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   921
		<form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo pun_link($pun_url['admin_users']) ?>&amp;action=find_user">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   922
			<div class="hidden">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   923
				<input type="hidden" name="csrf_token" value="<?php echo generate_form_token(pun_link($pun_url['admin_users']).'&action=find_user') ?>" />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   924
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   925
<?php ($hook = get_hook('aus_search_pre_user_search_fieldset')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   926
			<fieldset class="frm-set set<?php echo ++$pun_page['set_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   927
				<legend class="frm-legend"><strong><?php echo $lang_admin['User search legend'] ?></strong></legend>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   928
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   929
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   930
						<span class="fld-label"><?php echo $lang_admin['Username'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   931
						<span class="input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="username" size="25" maxlength="25" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   932
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   933
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   934
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   935
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   936
						<span class="fld-label"><?php echo $lang_admin['E-mail address'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   937
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[email]" size="30" maxlength="80" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   938
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   939
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   940
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   941
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   942
						<span class="fld-label"><?php echo $lang_admin['Title'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   943
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[title]" size="30" maxlength="50" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   944
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   945
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   946
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   947
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   948
						<span class="fld-label"><?php echo $lang_admin['Real name'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   949
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[realname]" size="30" maxlength="40" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   950
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   951
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   952
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   953
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   954
						<span class="fld-label"><?php echo $lang_admin['Website'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   955
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[url]" size="35" maxlength="100" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   956
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   957
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   958
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   959
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   960
						<span class="fld-label">Jabber</span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   961
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[jabber]" size="30" maxlength="80" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   962
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   963
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   964
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   965
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   966
						<span class="fld-label">ICQ</span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   967
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[icq]" size="12" maxlength="12" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   968
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   969
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   970
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   971
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   972
						<span class="fld-label">MSN Messenger</span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   973
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[msn]" size="30" maxlength="80" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   974
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   975
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   976
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   977
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   978
						<span class="fld-label">AOL IM</span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   979
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[aim]" size="20" maxlength="20" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   980
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   981
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   982
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   983
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   984
						<span class="fld-label">Yahoo! Messenger</span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   985
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[yahoo]" size="20" maxlength="20" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   986
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   987
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   988
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   989
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   990
						<span class="fld-label"><?php echo $lang_admin['Location'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   991
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[location]" size="30" maxlength="30" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   992
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   993
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   994
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   995
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   996
						<span class="fld-label"><?php echo $lang_admin['Signature'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   997
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[signature]" size="35" maxlength="512" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   998
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
   999
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1000
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1001
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1002
						<span class="fld-label"><?php echo $lang_admin['Admin note'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1003
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="form[admin_note]" size="30" maxlength="30" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1004
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1005
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1006
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1007
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1008
						<span class="fld-label"><?php echo $lang_admin['More posts than'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1009
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="posts_greater" size="5" maxlength="8" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1010
						<span class="fld-extra"><?php echo $lang_admin['Number of posts'] ?></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1011
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1012
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1013
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1014
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1015
						<span class="fld-label"><?php echo $lang_admin['Less posts than'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1016
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="posts_less" size="5" maxlength="8" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1017
						<span class="fld-extra"><?php echo $lang_admin['Number of posts'] ?></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1018
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1019
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1020
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1021
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1022
						<span class="fld-label"><?php echo $lang_admin['Last post after'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1023
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="last_post_after" size="24" maxlength="19" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1024
 						<span class="fld-extra">(yyyy-mm-dd hh:mm:ss)</span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1025
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1026
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1027
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1028
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1029
						<span class="fld-label"><?php echo $lang_admin['Last post before'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1030
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="last_post_before" size="24" maxlength="19" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1031
						<span class="fld-extra">(yyyy-mm-dd hh:mm:ss)</span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1032
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1033
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1034
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1035
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1036
						<span class="fld-label"><?php echo $lang_admin['Registered after'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1037
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="registered_after" size="24" maxlength="19" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1038
						<span class="fld-extra">(yyyy-mm-dd hh:mm:ss)</span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1039
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1040
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1041
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1042
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1043
						<span class="fld-label"><?php echo $lang_admin['Registered before'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1044
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="registered_before" size="24" maxlength="19" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1045
						<span class="fld-extra">(yyyy-mm-dd hh:mm:ss)</span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1046
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1047
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1048
<?php ($hook = get_hook('aus_search_user_search_end')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1049
			</fieldset>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1050
<?php ($hook = get_hook('aus_search_pre_results_fieldset')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1051
			<fieldset class="frm-set set<?php echo ++$pun_page['set_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1052
				<legend class="frm-legend"><strong><?php echo $lang_admin['User results legend'] ?></strong></legend>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1053
				<div class="frm-fld select">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1054
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1055
						<span class="fld-label"><?php echo $lang_admin['Order by'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1056
						<span class="fld-input"><select id="fld<?php echo $pun_page['fld_count'] ?>" name="order_by">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1057
							<option value="username" selected="selected"><?php echo strtolower($lang_admin['Username']) ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1058
							<option value="email"><?php echo strtolower($lang_admin['E-mail']) ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1059
							<option value="num_posts"><?php echo strtolower($lang_admin['Posts']) ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1060
							<option value="last_post"><?php echo $lang_admin['Last post'] ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1061
							<option value="registered"><?php echo $lang_admin['Registered'] ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1062
						</select></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1063
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1064
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1065
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1066
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1067
						<span class="fld-label"><?php echo $lang_admin['Sort order'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1068
						<span class="fld-input"><select id="fld<?php echo $pun_page['fld_count'] ?>" name="direction">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1069
							<option value="ASC" selected="selected"><?php echo $lang_admin['Ascending'] ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1070
							<option value="DESC"><?php echo $lang_admin['Descending'] ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1071
						</select></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1072
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1073
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1074
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1075
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1076
						<span class="fld-label"><?php echo $lang_admin['User group'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1077
						<span class="fld-input"><select id="fld<?php echo $pun_page['fld_count'] ?>" name="user_group">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1078
							<option value="all" selected="selected"><?php echo $lang_admin['All groups'] ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1079
							<option value="<?php echo PUN_UNVERIFIED ?>"><?php echo $lang_admin['Unverified users'] ?></option>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1080
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1081
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1082
	$query = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1083
		'SELECT'	=> 'g.g_id, g.g_title',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1084
		'FROM'		=> 'groups AS g',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1085
		'WHERE'		=> 'g.g_id!='.PUN_GUEST,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1086
		'ORDER BY'	=> 'g.g_title'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1087
	);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1088
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1089
	($hook = get_hook('aus_qr_get_groups2')) ? eval($hook) : null;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1090
	$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1091
	while ($cur_group = $pun_db->fetch_assoc($result))
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1092
		echo "\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.htmlspecialchars($cur_group['g_title']).'</option>'."\n";
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1093
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1094
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1095
						</select></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1096
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1097
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1098
<?php ($hook = get_hook('aus_search_results_fieldset_end')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1099
			</fieldset>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1100
			<div class="frm-buttons">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1101
				<span class="submit"><input type="submit" class="button" name="find_user" value="<?php echo $lang_admin['Submit search'] ?>" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1102
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1103
		</form>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1104
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1105
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1106
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1107
// Reset fieldset counter
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1108
$pun_page['set_count'] = 0;
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1109
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1110
?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1111
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1112
	<div class="main-content frm">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1113
		<div class="frm-head">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1114
			<h2><span><?php echo $lang_admin['IP search head'] ?></span></h2>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1115
		</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1116
		<form class="frm-form" method="get" accept-charset="utf-8" action="<?php echo pun_link($pun_url['admin_users']) ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1117
<?php ($hook = get_hook('aus_search_pre_ip_search_fieldset')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1118
			<fieldset class="frm-set set<?php echo ++$pun_page['set_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1119
				<legend class="frm-legend"><strong><?php echo $lang_admin['IP search legend'] ?></strong></legend>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1120
				<div class="frm-fld text">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1121
					<label for="fld<?php echo ++$pun_page['fld_count'] ?>">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1122
						<span class="fld-label"><?php echo $lang_admin['IP address'] ?></span><br />
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1123
						<span class="fld-input"><input type="text" id="fld<?php echo $pun_page['fld_count'] ?>" name="show_users" size="18" maxlength="15" /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1124
					</label>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1125
				</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1126
<?php ($hook = get_hook('aus_search_ip_search_fieldset_end')) ? eval($hook) : null; ?>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1127
			</fieldset>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1128
			<div class="frm-buttons">
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1129
				<span class="submit"><input type="submit" value=" <?php echo $lang_admin['Submit search'] ?> " /></span>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1130
			</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1131
		</form>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1132
	</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1133
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1134
</div>
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1135
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1136
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1137
	require PUN_ROOT.'footer.php';
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
  1138
}