PageRenderTime 52ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/admin_bans.php

https://github.com/Dratone/EveBB
PHP | 569 lines | 462 code | 84 blank | 23 comment | 120 complexity | 534653c636fd4e51ffae52e1fa909661 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * Copyright (C) 2008-2010 FluxBB
  4. * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
  5. * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
  6. */
  7. // Tell header.php to use the admin template
  8. define('PUN_ADMIN_CONSOLE', 1);
  9. define('PUN_ROOT', dirname(__FILE__).'/');
  10. require PUN_ROOT.'include/common.php';
  11. require PUN_ROOT.'include/common_admin.php';
  12. if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_moderator'] != '1' || $pun_user['g_mod_ban_users'] == '0'))
  13. message($lang_common['No permission']);
  14. // Load the admin_bans.php language file
  15. require PUN_ROOT.'lang/'.$admin_language.'/admin_bans.php';
  16. // Add/edit a ban (stage 1)
  17. if (isset($_REQUEST['add_ban']) || isset($_GET['edit_ban']))
  18. {
  19. if (isset($_GET['add_ban']) || isset($_POST['add_ban']))
  20. {
  21. // If the ID of the user to ban was provided through GET (a link from profile.php)
  22. if (isset($_GET['add_ban']))
  23. {
  24. $user_id = intval($_GET['add_ban']);
  25. if ($user_id < 2)
  26. message($lang_common['Bad request']);
  27. $result = $db->query('SELECT group_id, username, email FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
  28. if ($db->num_rows($result))
  29. list($group_id, $ban_user, $ban_email) = $db->fetch_row($result);
  30. else
  31. message($lang_admin_bans['No user ID message']);
  32. }
  33. else // Otherwise the username is in POST
  34. {
  35. $ban_user = pun_trim($_POST['new_ban_user']);
  36. if ($ban_user != '')
  37. {
  38. $result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
  39. if ($db->num_rows($result))
  40. list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result);
  41. else
  42. message($lang_admin_bans['No user message']);
  43. }
  44. }
  45. // Make sure we're not banning an admin or moderator
  46. if (isset($group_id))
  47. {
  48. if ($group_id == PUN_ADMIN)
  49. message(sprintf($lang_admin_bans['User is admin message'], pun_htmlspecialchars($ban_user)));
  50. $result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
  51. $is_moderator_group = $db->result($result);
  52. if ($is_moderator_group)
  53. message(sprintf($lang_admin_bans['User is mod message'], pun_htmlspecialchars($ban_user)));
  54. } //End if.
  55. // If we have a $user_id, we can try to find the last known IP of that user
  56. if (isset($user_id))
  57. {
  58. $result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE poster_id='.$user_id.' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
  59. $ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
  60. if ($ban_ip == '')
  61. {
  62. $result = $db->query('SELECT registration_ip FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
  63. $ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
  64. }
  65. }
  66. $mode = 'add';
  67. }
  68. else // We are editing a ban
  69. {
  70. $ban_id = intval($_GET['edit_ban']);
  71. if ($ban_id < 1)
  72. message($lang_common['Bad request']);
  73. $result = $db->query('SELECT username, ip, email, message, expire FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Unable to fetch ban info', __FILE__, __LINE__, $db->error());
  74. if ($db->num_rows($result))
  75. list($ban_user, $ban_ip, $ban_email, $ban_message, $ban_expire) = $db->fetch_row($result);
  76. else
  77. message($lang_common['Bad request']);
  78. $diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
  79. $ban_expire = ($ban_expire != '') ? gmdate('Y-m-d', $ban_expire + $diff) : '';
  80. $mode = 'edit';
  81. }
  82. $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans']);
  83. $focus_element = array('bans2', 'ban_user');
  84. define('PUN_ACTIVE_PAGE', 'admin');
  85. require PUN_ROOT.'header.php';
  86. generate_admin_menu('bans');
  87. ?>
  88. <div class="blockform">
  89. <h2><span><?php echo $lang_admin_bans['Ban advanced head'] ?></span></h2>
  90. <div class="box">
  91. <form id="bans2" method="post" action="admin_bans.php">
  92. <div class="inform">
  93. <input type="hidden" name="mode" value="<?php echo $mode ?>" />
  94. <?php if ($mode == 'edit'): ?> <input type="hidden" name="ban_id" value="<?php echo $ban_id ?>" />
  95. <?php endif; ?> <fieldset>
  96. <legend><?php echo $lang_admin_bans['Ban advanced subhead'] ?></legend>
  97. <div class="infldset">
  98. <table class="aligntop" cellspacing="0">
  99. <tr>
  100. <th scope="row"><?php echo $lang_admin_bans['Username label'] ?></th>
  101. <td>
  102. <input type="text" name="ban_user" size="25" maxlength="25" value="<?php if (isset($ban_user)) echo pun_htmlspecialchars($ban_user); ?>" tabindex="1" />
  103. <span><?php echo $lang_admin_bans['Username help'] ?></span>
  104. </td>
  105. </tr>
  106. <tr>
  107. <th scope="row"><?php echo $lang_admin_bans['IP label'] ?></th>
  108. <td>
  109. <input type="text" name="ban_ip" size="45" maxlength="255" value="<?php if (isset($ban_ip)) echo $ban_ip; ?>" tabindex="2" />
  110. <span><?php echo $lang_admin_bans['IP help'] ?><?php if ($ban_user != '' && isset($user_id)) printf(' '.$lang_admin_bans['IP help link'], '<a href="admin_users.php?ip_stats='.$user_id.'">'.$lang_admin_common['here'].'</a>') ?></span>
  111. </td>
  112. </tr>
  113. <tr>
  114. <th scope="row"><?php echo $lang_admin_bans['E-mail label'] ?></th>
  115. <td>
  116. <input type="text" name="ban_email" size="40" maxlength="80" value="<?php if (isset($ban_email)) echo $ban_email; ?>" tabindex="3" />
  117. <span><?php echo $lang_admin_bans['E-mail help'] ?></span>
  118. </td>
  119. </tr>
  120. </table>
  121. <p class="topspace"><strong class="warntext"><?php echo $lang_admin_bans['Ban IP range info'] ?></strong></p>
  122. </div>
  123. </fieldset>
  124. </div>
  125. <div class="inform">
  126. <fieldset>
  127. <legend><?php echo $lang_admin_bans['Message expiry subhead'] ?></legend>
  128. <div class="infldset">
  129. <table class="aligntop" cellspacing="0">
  130. <tr>
  131. <th scope="row"><?php echo $lang_admin_bans['Ban message label'] ?></th>
  132. <td>
  133. <input type="text" name="ban_message" size="50" maxlength="255" value="<?php if (isset($ban_message)) echo pun_htmlspecialchars($ban_message); ?>" tabindex="4" />
  134. <span><?php echo $lang_admin_bans['Ban message help'] ?></span>
  135. </td>
  136. </tr>
  137. <tr>
  138. <th scope="row"><?php echo $lang_admin_bans['Expire date label'] ?></th>
  139. <td>
  140. <input type="text" name="ban_expire" size="17" maxlength="10" value="<?php if (isset($ban_expire)) echo $ban_expire; ?>" tabindex="5" />
  141. <span><?php echo $lang_admin_bans['Expire date help'] ?></span>
  142. </td>
  143. </tr>
  144. </table>
  145. </div>
  146. </fieldset>
  147. </div>
  148. <p class="submitend"><input type="submit" name="add_edit_ban" value="<?php echo $lang_admin_common['Save'] ?>" tabindex="6" /></p>
  149. </form>
  150. </div>
  151. </div>
  152. <div class="clearer"></div>
  153. </div>
  154. <?php
  155. require PUN_ROOT.'footer.php';
  156. }
  157. // Add/edit a ban (stage 2)
  158. else if (isset($_POST['add_edit_ban']))
  159. {
  160. confirm_referrer('admin_bans.php');
  161. $ban_user = pun_trim($_POST['ban_user']);
  162. $ban_ip = trim($_POST['ban_ip']);
  163. $ban_email = strtolower(trim($_POST['ban_email']));
  164. $ban_message = pun_trim($_POST['ban_message']);
  165. $ban_expire = trim($_POST['ban_expire']);
  166. if ($ban_user == '' && $ban_ip == '' && $ban_email == '')
  167. message($lang_admin_bans['Must enter message']);
  168. else if (strtolower($ban_user) == 'guest')
  169. message($lang_admin_bans['Cannot ban guest message']);
  170. // Make sure we're not banning an admin or moderator
  171. if (!empty($ban_user))
  172. {
  173. $result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
  174. if ($db->num_rows($result))
  175. {
  176. $group_id = $db->result($result);
  177. if ($group_id == PUN_ADMIN)
  178. message(sprintf($lang_admin_bans['User is admin message'], pun_htmlspecialchars($ban_user)));
  179. $result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
  180. $is_moderator_group = $db->result($result);
  181. if ($is_moderator_group)
  182. message(sprintf($lang_admin_bans['User is mod message'], pun_htmlspecialchars($ban_user)));
  183. } //End if.
  184. } //End if.
  185. // Validate IP/IP range (it's overkill, I know)
  186. if ($ban_ip != '')
  187. {
  188. $ban_ip = preg_replace('/\s{2,}/S', ' ', $ban_ip);
  189. $addresses = explode(' ', $ban_ip);
  190. $addresses = array_map('pun_trim', $addresses);
  191. for ($i = 0; $i < count($addresses); ++$i)
  192. {
  193. if (strpos($addresses[$i], ':') !== false)
  194. {
  195. $octets = explode(':', $addresses[$i]);
  196. for ($c = 0; $c < count($octets); ++$c)
  197. {
  198. $octets[$c] = ltrim($octets[$c], "0");
  199. if ($c > 7 || (!empty($octets[$c]) && !ctype_xdigit($octets[$c])) || intval($octets[$c], 16) > 65535)
  200. message($lang_admin_bans['Invalid IP message']);
  201. }
  202. $cur_address = implode(':', $octets);
  203. $addresses[$i] = $cur_address;
  204. }
  205. else
  206. {
  207. $octets = explode('.', $addresses[$i]);
  208. for ($c = 0; $c < count($octets); ++$c)
  209. {
  210. $octets[$c] = (strlen($octets[$c]) > 1) ? ltrim($octets[$c], "0") : $octets[$c];
  211. if ($c > 3 || preg_match('/[^0-9]/', $octets[$c]) || intval($octets[$c]) > 255)
  212. message($lang_admin_bans['Invalid IP message']);
  213. }
  214. $cur_address = implode('.', $octets);
  215. $addresses[$i] = $cur_address;
  216. }
  217. }
  218. $ban_ip = implode(' ', $addresses);
  219. }
  220. require PUN_ROOT.'include/email.php';
  221. if ($ban_email != '' && !is_valid_email($ban_email))
  222. {
  223. if (!preg_match('/^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $ban_email))
  224. message($lang_admin_bans['Invalid e-mail message']);
  225. }
  226. if ($ban_expire != '' && $ban_expire != 'Never')
  227. {
  228. $ban_expire = strtotime($ban_expire.' GMT');
  229. if ($ban_expire == -1 || !$ban_expire)
  230. message($lang_admin_bans['Invalid date message'].' '.$lang_admin_bans['Invalid date reasons']);
  231. $diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
  232. $ban_expire -= $diff;
  233. if ($ban_expire <= time())
  234. message($lang_admin_bans['Invalid date message'].' '.$lang_admin_bans['Invalid date reasons']);
  235. }
  236. else
  237. $ban_expire = 'NULL';
  238. $ban_user = ($ban_user != '') ? '\''.$db->escape($ban_user).'\'' : 'NULL';
  239. $ban_ip = ($ban_ip != '') ? '\''.$db->escape($ban_ip).'\'' : 'NULL';
  240. $ban_email = ($ban_email != '') ? '\''.$db->escape($ban_email).'\'' : 'NULL';
  241. $ban_message = ($ban_message != '') ? '\''.$db->escape($ban_message).'\'' : 'NULL';
  242. if ($_POST['mode'] == 'add')
  243. $db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire, ban_creator) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.', '.$pun_user['id'].')') or error('Unable to add ban', __FILE__, __LINE__, $db->error());
  244. else
  245. $db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Unable to update ban', __FILE__, __LINE__, $db->error());
  246. // Regenerate the bans cache
  247. if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
  248. require PUN_ROOT.'include/cache.php';
  249. generate_bans_cache();
  250. if ($_POST['mode'] == 'edit')
  251. redirect('admin_bans.php', $lang_admin_bans['Ban edited redirect']);
  252. else
  253. redirect('admin_bans.php', $lang_admin_bans['Ban added redirect']);
  254. }
  255. // Remove a ban
  256. else if (isset($_GET['del_ban']))
  257. {
  258. confirm_referrer('admin_bans.php');
  259. $ban_id = intval($_GET['del_ban']);
  260. if ($ban_id < 1)
  261. message($lang_common['Bad request']);
  262. $db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Unable to delete ban', __FILE__, __LINE__, $db->error());
  263. // Regenerate the bans cache
  264. if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
  265. require PUN_ROOT.'include/cache.php';
  266. generate_bans_cache();
  267. redirect('admin_bans.php', $lang_admin_bans['Ban removed redirect']);
  268. }
  269. // Find bans
  270. else if (isset($_GET['find_ban']))
  271. {
  272. $form = isset($_GET['form']) ? $_GET['form'] : array();
  273. // trim() all elements in $form
  274. $form = array_map('pun_trim', $form);
  275. $conditions = $query_str = array();
  276. $expire_after = isset($_GET['expire_after']) ? trim($_GET['expire_after']) : '';
  277. $expire_before = isset($_GET['expire_before']) ? trim($_GET['expire_before']) : '';
  278. $order_by = isset($_GET['order_by']) && in_array($_GET['order_by'], array('username', 'ip', 'email', 'expire')) ? 'b.'.$_GET['order_by'] : 'b.username';
  279. $direction = isset($_GET['direction']) && $_GET['direction'] == 'DESC' ? 'DESC' : 'ASC';
  280. $query_str[] = 'order_by='.$order_by;
  281. $query_str[] = 'direction='.$direction;
  282. // Try to convert date/time to timestamps
  283. if ($expire_after != '')
  284. {
  285. $query_str[] = 'expire_after='.$expire_after;
  286. $expire_after = strtotime($expire_after);
  287. if ($expire_after === false || $expire_after == -1)
  288. message($lang_admin_bans['Invalid date message']);
  289. $conditions[] = 'b.expire>'.$expire_after;
  290. }
  291. if ($expire_before != '')
  292. {
  293. $query_str[] = 'expire_before='.$expire_before;
  294. $expire_before = strtotime($expire_before);
  295. if ($expire_before === false || $expire_before == -1)
  296. message($lang_admin_bans['Invalid date message']);
  297. $conditions[] = 'b.expire<'.$expire_before;
  298. }
  299. $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
  300. foreach ($form as $key => $input)
  301. {
  302. if ($input != '' && in_array($key, array('username', 'ip', 'email', 'message')))
  303. {
  304. $conditions[] = 'b.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
  305. $query_str[] = 'form%5B'.$key.'%5D='.urlencode($input);
  306. }
  307. }
  308. // Fetch ban count
  309. $result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'bans as b WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '')) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
  310. $num_bans = $db->result($result);
  311. // Determine the ban offset (based on $_GET['p'])
  312. $num_pages = ceil($num_bans / 50);
  313. $p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
  314. $start_from = 50 * ($p - 1);
  315. // Generate paging links
  316. $paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'admin_bans.php?find_ban=&amp;'.implode('&amp;', $query_str));
  317. $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans'], $lang_admin_bans['Results head']);
  318. define('PUN_ACTIVE_PAGE', 'admin');
  319. require PUN_ROOT.'header.php';
  320. ?>
  321. <div class="linkst">
  322. <div class="inbox crumbsplus">
  323. <ul class="crumbs">
  324. <li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
  325. <li><span>»&#160;</span><a href="admin_bans.php"><?php echo $lang_admin_common['Bans'] ?></a></li>
  326. <li><span>»&#160;</span><strong><?php echo $lang_admin_bans['Results head'] ?></strong></li>
  327. </ul>
  328. <div class="pagepost">
  329. <p class="pagelink"><?php echo $paging_links ?></p>
  330. </div>
  331. <div class="clearer"></div>
  332. </div>
  333. </div>
  334. <div id="bans1" class="blocktable">
  335. <h2><span><?php echo $lang_admin_bans['Results head'] ?></span></h2>
  336. <div class="box">
  337. <div class="inbox">
  338. <table cellspacing="0">
  339. <thead>
  340. <tr>
  341. <th class="tcl" scope="col"><?php echo $lang_admin_bans['Results username head'] ?></th>
  342. <th class="tc2" scope="col"><?php echo $lang_admin_bans['Results e-mail head'] ?></th>
  343. <th class="tc3" scope="col"><?php echo $lang_admin_bans['Results IP address head'] ?></th>
  344. <th class="tc4" scope="col"><?php echo $lang_admin_bans['Results expire head'] ?></th>
  345. <th class="tc5" scope="col"><?php echo $lang_admin_bans['Results message head'] ?></th>
  346. <th class="tc6" scope="col"><?php echo $lang_admin_bans['Results banned by head'] ?></th>
  347. <th class="tcr" scope="col"><?php echo $lang_admin_bans['Results actions head'] ?></th>
  348. </tr>
  349. </thead>
  350. <tbody>
  351. <?php
  352. $result = $db->query('SELECT b.id, b.username, b.ip, b.email, b.message, b.expire, b.ban_creator, u.username AS ban_creator_username FROM '.$db->prefix.'bans AS b LEFT JOIN '.$db->prefix.'users AS u ON b.ban_creator=u.id WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '').' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction).' LIMIT '.$start_from.', 50') or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
  353. if ($db->num_rows($result))
  354. {
  355. while ($ban_data = $db->fetch_assoc($result))
  356. {
  357. $actions = '<a href="admin_bans.php?edit_ban='.$ban_data['id'].'">'.$lang_admin_common['Edit'].'</a> | <a href="admin_bans.php?del_ban='.$ban_data['id'].'">'.$lang_admin_common['Remove'].'</a>';
  358. $expire = format_time($ban_data['expire'], true);
  359. ?>
  360. <tr>
  361. <td class="tcl"><?php echo ($ban_data['username'] != '') ? pun_htmlspecialchars($ban_data['username']) : '&#160;' ?></td>
  362. <td class="tc2"><?php echo ($ban_data['email'] != '') ? $ban_data['email'] : '&#160;' ?></td>
  363. <td class="tc3"><?php echo ($ban_data['ip'] != '') ? $ban_data['ip'] : '&#160;' ?></td>
  364. <td class="tc4"><?php echo $expire ?></td>
  365. <td class="tc5"><?php echo ($ban_data['message'] != '') ? pun_htmlspecialchars($ban_data['message']) : '&#160;' ?></td>
  366. <td class="tc6"><?php echo ($ban_data['ban_creator_username'] != '') ? '<a href="profile.php?id='.$ban_data['ban_creator'].'">'.pun_htmlspecialchars($ban_data['ban_creator_username']).'</a>' : $lang_admin_bans['Unknown'] ?></td>
  367. <td class="tcr"><?php echo $actions ?></td>
  368. </tr>
  369. <?php
  370. }
  371. }
  372. else
  373. echo "\t\t\t\t".'<tr><td class="tcl" colspan="7">'.$lang_admin_bans['No match'].'</td></tr>'."\n";
  374. ?>
  375. </tbody>
  376. </table>
  377. </div>
  378. </div>
  379. </div>
  380. <div class="linksb">
  381. <div class="inbox crumbsplus">
  382. <div class="pagepost">
  383. <p class="pagelink"><?php echo $paging_links ?></p>
  384. </div>
  385. <ul class="crumbs">
  386. <li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
  387. <li><span>»&#160;</span><a href="admin_bans.php"><?php echo $lang_admin_common['Bans'] ?></a></li>
  388. <li><span>»&#160;</span><strong><?php echo $lang_admin_bans['Results head'] ?></strong></li>
  389. </ul>
  390. <div class="clearer"></div>
  391. </div>
  392. </div>
  393. <?php
  394. require PUN_ROOT.'footer.php';
  395. }
  396. $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans']);
  397. $focus_element = array('bans', 'new_ban_user');
  398. define('PUN_ACTIVE_PAGE', 'admin');
  399. require PUN_ROOT.'header.php';
  400. generate_admin_menu('bans');
  401. ?>
  402. <div class="blockform">
  403. <h2><span><?php echo $lang_admin_bans['New ban head'] ?></span></h2>
  404. <div class="box">
  405. <form id="bans" method="post" action="admin_bans.php?action=more">
  406. <div class="inform">
  407. <fieldset>
  408. <legend><?php echo $lang_admin_bans['Add ban subhead'] ?></legend>
  409. <div class="infldset">
  410. <table class="aligntop" cellspacing="0">
  411. <tr>
  412. <th scope="row"><?php echo $lang_admin_bans['Username label'] ?><div><input type="submit" name="add_ban" value="<?php echo $lang_admin_common['Add'] ?>" tabindex="2" /></div></th>
  413. <td>
  414. <input type="text" name="new_ban_user" size="25" maxlength="25" tabindex="1" />
  415. <span><?php echo $lang_admin_bans['Username advanced help'] ?></span>
  416. </td>
  417. </tr>
  418. </table>
  419. </div>
  420. </fieldset>
  421. </div>
  422. </form>
  423. </div>
  424. <h2 class="block2"><span><?php echo $lang_admin_bans['Ban search head'] ?></span></h2>
  425. <div class="box">
  426. <form id="find_band" method="get" action="admin_bans.php">
  427. <p class="submittop"><input type="submit" name="find_ban" value="<?php echo $lang_admin_bans['Submit search'] ?>" tabindex="3" /></p>
  428. <div class="inform">
  429. <fieldset>
  430. <legend><?php echo $lang_admin_bans['Ban search subhead'] ?></legend>
  431. <div class="infldset">
  432. <p><?php echo $lang_admin_bans['Ban search info'] ?></p>
  433. <table class="aligntop" cellspacing="0">
  434. <tr>
  435. <th scope="row"><?php echo $lang_admin_bans['Username label'] ?></th>
  436. <td><input type="text" name="form[username]" size="25" maxlength="25" tabindex="4" /></td>
  437. </tr>
  438. <tr>
  439. <th scope="row"><?php echo $lang_admin_bans['IP label'] ?></th>
  440. <td><input type="text" name="form[ip]" size="30" maxlength="255" tabindex="5" /></td>
  441. </tr>
  442. <tr>
  443. <th scope="row"><?php echo $lang_admin_bans['E-mail label'] ?></th>
  444. <td><input type="text" name="form[email]" size="30" maxlength="80" tabindex="6" /></td>
  445. </tr>
  446. <tr>
  447. <th scope="row"><?php echo $lang_admin_bans['Message label'] ?></th>
  448. <td><input type="text" name="form[message]" size="30" maxlength="255" tabindex="7" /></td>
  449. </tr>
  450. <tr>
  451. <th scope="row"><?php echo $lang_admin_bans['Expire after label'] ?></th>
  452. <td><input type="text" name="expire_after" size="10" maxlength="10" tabindex="8" />
  453. <span><?php echo $lang_admin_bans['Date help'] ?></span></td>
  454. </tr>
  455. <tr>
  456. <th scope="row"><?php echo $lang_admin_bans['Expire before label'] ?></th>
  457. <td><input type="text" name="expire_before" size="10" maxlength="10" tabindex="9" />
  458. <span><?php echo $lang_admin_bans['Date help'] ?></span></td>
  459. </tr>
  460. <tr>
  461. <th scope="row"><?php echo $lang_admin_bans['Order by label'] ?></th>
  462. <td>
  463. <select name="order_by" tabindex="10">
  464. <option value="username" selected="selected"><?php echo $lang_admin_bans['Order by username'] ?></option>
  465. <option value="ip"><?php echo $lang_admin_bans['Order by ip'] ?></option>
  466. <option value="email"><?php echo $lang_admin_bans['Order by e-mail'] ?></option>
  467. <option value="expire"><?php echo $lang_admin_bans['Order by expire'] ?></option>
  468. </select>&#160;&#160;&#160;<select name="direction" tabindex="11">
  469. <option value="ASC" selected="selected"><?php echo $lang_admin_bans['Ascending'] ?></option>
  470. <option value="DESC"><?php echo $lang_admin_bans['Descending'] ?></option>
  471. </select>
  472. </td>
  473. </tr>
  474. </table>
  475. </div>
  476. </fieldset>
  477. </div>
  478. <p class="submitend"><input type="submit" name="find_ban" value="<?php echo $lang_admin_bans['Submit search'] ?>" tabindex="12" /></p>
  479. </form>
  480. </div>
  481. </div>
  482. <div class="clearer"></div>
  483. </div>
  484. <?php
  485. require PUN_ROOT.'footer.php';