db_Select("generic", "gen_ip", "gen_id={$banID}"))
{
$at = $sql2->db_Fetch();
$banIP = $at['gen_ip'];
}
}
$sql2->db_Delete("generic", "gen_id='{$banID}' "); // Delete from generic table
if ($banIP == '') return FALSE;
$sql2->db_Delete("banlist", "banlist_ip='{$banIP}'"); // Delete from main banlist
return TRUE;
}
if(isset($_POST['delbanSubmit']))
{
$message = '';
$delcount = 0;
$spacer = '';
foreach($_POST['fladelete'] as $delete)
{
$delcount ++;
$sql -> db_Delete("generic", "gen_id='{$delete}' ");
}
if ($delcount)
{
$message .= FLALAN_3.": ".$delcount;
$spacer = '
';
}
$bancount = 0;
foreach($_POST['flaban'] as $ban)
{
if($sql -> db_Select("generic", "*", "gen_id={$ban}"))
{
$at = $sql -> db_Fetch();
if (!$e107->add_ban(4,FLALAN_4,$at['gen_ip'],ADMINID))
{ // IP on whitelist (although possibly we shouldn't get to this stage, but check anyway
$message .= $spacer.str_replace(FLALAN_18,'--IP--',$at['gen_ip']);
$spacer = '
';
}
// $banlist_ip = $at['gen_ip'];
// $sql->db_Insert("banlist", "'$banlist_ip', '".ADMINID."', '".FLALAN_4."' ");
$sql -> db_Delete("generic", "gen_id='{$ban}' ");
$bancount ++;
}
}
$message .= $spacer.FLALAN_5.": ".$bancount;
}
if(e_QUERY == "dabl")
{
$sql -> db_Select("generic", 'gen_ip,gen_id',"gen_type='auto_banned' ");
while ($row = $sql->db_Fetch())
{
if (deleteBan($row['gen_id'],$row['gen_ip']))
{
$delcount ++;
}
}
$message = FLALAN_17;
}
// Now display any outstanding auto-banned IP addresses
if($sql -> db_Select("generic", "*", "gen_type='auto_banned' ORDER BY gen_datestamp DESC "))
{
$abArray = $sql -> db_getList();
$message = FLALAN_15;
foreach($abArray as $ab)
{
$message .= " - ".$ab['gen_ip'];
}
$message .= "