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