Browse Source

fixed multiple "hidden ban" bugs

pull/40/head
Savetheinternet 13 years ago
parent
commit
23cfaf0cd3
  1. 56
      mod.php

56
mod.php

@ -1440,7 +1440,7 @@
} }
} }
if(hasPermission($config['mod']['view_banexpired'])) { if(hasPermission($config['mod']['view_banexpired'])) {
$query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` INNER JOIN `mods` ON `mod` = `mods`.`id` GROUP BY `ip` ORDER BY (`expires` IS NOT NULL AND `expires` < :time), `set` DESC"); $query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` LEFT JOIN `mods` ON `mod` = `mods`.`id` GROUP BY `ip` ORDER BY (`expires` IS NOT NULL AND `expires` < :time), `set` DESC");
$query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':time', time(), PDO::PARAM_INT);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
} else { } else {
@ -1503,17 +1503,21 @@
// Staff // Staff
'<td>' . '<td>' .
(!hasPermission($config['mod']['view_banstaff']) ? (isset($ban['username']) ?
($config['mod']['view_banquestionmark'] ? (!hasPermission($config['mod']['view_banstaff']) ?
'?' ($config['mod']['view_banquestionmark'] ?
'?'
:
($ban['type'] == JANITOR ? 'Janitor' :
($ban['type'] == MOD ? 'Mod' :
($ban['type'] == ADMIN ? 'Admin' :
'?')))
)
: :
($ban['type'] == JANITOR ? 'Janitor' : utf8tohtml($ban['username'])
($ban['type'] == MOD ? 'Mod' :
($ban['type'] == ADMIN ? 'Admin' :
'?')))
) )
: :
utf8tohtml($ban['username']) '<em>deleted?</em>'
) . ) .
'</td>' . '</td>' .
@ -2196,7 +2200,7 @@
} }
if(hasPermission($config['mod']['view_ban'])) { if(hasPermission($config['mod']['view_ban'])) {
$query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` INNER JOIN `mods` ON `mod` = `mods`.`id` WHERE `ip` = :ip"); $query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE `ip` = :ip");
$query->bindValue(':ip', $ip); $query->bindValue(':ip', $ip);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
@ -2219,11 +2223,16 @@
// Board // Board
'<tr><th>Board</th><td>' . '<tr><th>Board</th><td>' .
(isset($ban['uri']) ? (isset($ban['board']) ?
sprintf($config['board_abbreviation'], $ban['uri']) (isset($ban['uri']) ?
sprintf($config['board_abbreviation'], $ban['uri'])
:
'<em>deleted?</em>'
)
: :
'<em>all boards</em>' '<em>all boards</em>'
) . '</td></tr>' . ) .
'</td></tr>' .
// Set // Set
'<tr><th>Set</th><td>' . date($config['post_date'], $ban['set']) . '</td></tr>' . '<tr><th>Set</th><td>' . date($config['post_date'], $ban['set']) . '</td></tr>' .
@ -2239,17 +2248,20 @@
// Staff // Staff
'<tr><th>Staff</th><td>' . '<tr><th>Staff</th><td>' .
(!hasPermission($config['mod']['view_banstaff']) ? (isset($ban['username']) ?
($config['mod']['view_banquestionmark'] ? (!hasPermission($config['mod']['view_banstaff']) ?
'?' ($config['mod']['view_banquestionmark'] ?
'?'
:
($ban['type'] == JANITOR ? 'Janitor' :
($ban['type'] == MOD ? 'Mod' :
($ban['type'] == ADMIN ? 'Admin' :
'?')))
)
: :
($ban['type'] == JANITOR ? 'Janitor' : utf8tohtml($ban['username'])
($ban['type'] == MOD ? 'Mod' :
($ban['type'] == ADMIN ? 'Admin' :
'?')))
) )
: : '<em>deleted?</em>'
utf8tohtml($ban['username'])
) . ) .
'</td></tr></table>' . '</td></tr></table>' .

Loading…
Cancel
Save