From 803f0c8ce1487ea791824197de9d1ee140127838 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Tue, 17 Sep 2013 09:35:13 +1000 Subject: Fix search for new bans table --- inc/mod/pages.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'inc/mod') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 0b9c92a1..c1f35c87 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -289,7 +289,7 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { } if ($type == 'bans') { - $query = 'SELECT ``bans``.*, `username` FROM ``bans`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE ' . $sql_like . ' ORDER BY (`expires` IS NOT NULL AND `expires` < UNIX_TIMESTAMP()), `created` DESC'; + $query = 'SELECT ``bans``.*, `username` FROM ``bans`` LEFT JOIN ``mods`` ON `creator` = ``mods``.`id` WHERE ' . $sql_like . ' ORDER BY (`expires` IS NOT NULL AND `expires` < UNIX_TIMESTAMP()), `created` DESC'; $sql_table = 'bans'; if (!hasPermission($config['mod']['view_banlist'])) error($config['error']['noaccess']); @@ -317,8 +317,9 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { if ($type == 'bans') { foreach ($results as &$ban) { - if (filter_var($ban['ip'], FILTER_VALIDATE_IP) !== false) - $ban['real_ip'] = true; + $ban['mask'] = Bans::range_to_string(array($ban['ipstart'], $ban['ipend'])); + if (filter_var($ban['mask'], FILTER_VALIDATE_IP) !== false) + $ban['single_addr'] = true; } } -- cgit v1.3