Skip to content

Commit

Permalink
Lookup user's registration IP when banning user without posts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy Ton committed Jul 28, 2010
1 parent 0b85381 commit 3a1dbda
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admin_bans.php
Expand Up @@ -61,6 +61,12 @@
{
$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());
$ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';

if ($ban_ip == '')
{
$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());
$ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
}
}

$mode = 'add';
Expand Down

0 comments on commit 3a1dbda

Please sign in to comment.