/*************************************************************************** * This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002 * by Tom Nitzschner ([email]tom@toms-home.com[/email]) * [url]http://bbtonuke.sourceforge.net[/url] (or [url]http://www.toms-home.com)[/url] * * As always, make a backup before messing with anything. All code * release by me is considered sample code only. It may be fully * functual, but you use it at your own risk, if you break it, * you get to fix it too. No waranty is given or implied. * * Please post all questions/request about this port on [url]http://bbtonuke.sourceforge.net[/url] first, * then on my site. All original header code and copyright messages will be maintained * to give credit where credit is due. If you modify this, the only requirement is * that you also maintain all original copyright messages. All my work is released * under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information. * ***************************************************************************/
/*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/
for($i = 0; $i { // // This ereg match is based on one by [email]php@unreelpro.com[/email] // contained in the annotated php manual at php.com (ereg // section) // if ( eregi('^(([[:alnum:]\*]+([-_.][[:alnum:]\*]+)*\.?)|(\*))@([[:alnum:]]+([-_]?[[:alnum:]]+)*\.){1,3}([[:alnum:]]{2,6})$', trim($email_list_temp[$i])) ) { $email_list[] = trim($email_list_temp[$i]); } } }
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_ip) VALUES ('" . $ip_list[$i] . "')"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't insert ban_ip info into database", "", __LINE__, __FILE__, $sql); } } }
// // Now we'll delete all entries from the session table with any of the banned // user or IP info just entered into the ban table ... this will force a session // initialisation resulting in an instant ban // if ( $kill_session_sql != ' ) { $sql = "DELETE FROM " . SESSIONS_TABLE . " WHERE $kill_session_sql"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't delete banned sessions from database", "", __LINE__, __FILE__, $sql); } }
if ( $where_sql != ' ) { $sql = "DELETE FROM " . BANLIST_TABLE . " WHERE ban_id IN ($where_sql)"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't delete ban info from database", "", __LINE__, __FILE__, $sql); } }
$sql = "SELECT ban_id, ban_ip, ban_email FROM " . BANLIST_TABLE; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select current ip ban list', ', __LINE__, __FILE__, $sql); }