How to restrict the visitor's ip address (PHPBB Code) Code :? Php /************************************** * ************************************ admin_user_ban.php * ------------------- * begin: tuesday, J label: phpBB
Code: /*************************************** ************************************
* Admin_user_ban.php
*-------------------
* Begin: Tuesday, Jul 31,200 1
* Copyright: (C) 2001 The phpBB Group
* Email: [email] support@phpbb.com [/email]
*
* $ Id: admin_user_ban.php, v 1.21.2.2 2002/05/12 15:57:45 psotfx Exp $
*
*
**************************************** ***********************************/
/*************************************** ************************************
* 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
* The Free Software Foundation; either version 2 of the License, or
* (At your option) any later version.
*
**************************************** ***********************************/
//
// 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 );
}
}
For ($ I = 0; $ I <count ($ email_list); $ I ++)
{
$ In_banlist = false;
For ($ j = 0; $ j <count ($ current_banlist); $ j ++)
{
If ($ email_list [$ I] = $ current_banlist [$ j] ['ban _ email '])
{
$ In_banlist = true;
}
}
$ Template-> assign_vars (array (
'L _ BAN_TITLE '=> $ lang ['ban _ control'],
'L _ BAN_EXPLAIN '=> $ lang ['ban _ explain'],
'L _ ban_explain_warn' => $ lang ['ban _ explain_warn'],
'L _ ip_or_hostname' => $ lang ['IP _ hostname'],
'L _ EMAIL_ADDRESS '=> $ lang ['email _ address'],
'L _ SUBMIT '=> $ lang ['submit'],
'L _ reset' => $ lang ['reset'],
$ Template-> assign_vars (array (
'L _ ban_user' => $ lang ['ban _ username'],
'L _ BAN_USER_EXPLAIN '=> $ lang ['ban _ username_explain'],
'L _ BAN_IP '=> $ lang ['ban _ IP'],
'L _ BAN_IP_EXPLAIN '=> $ lang ['ban _ IP_explain'],
'L _ BAN_EMAIL '=> $ lang ['ban _ email'],
'L _ BAN_EMAIL_EXPLAIN '=> $ lang ['ban _ email_explain'])
);
$ SQL = "SELECT B. ban_id, u. user_id, u. username
FROM ". BANLIST_TABLE." B, ". USERS_TABLE." u
WHERE u. user_id = B. ban_userid
AND B. ban_userid <> 0
AND u. user_id <> ". ANONYMOUS ."
Order by u. user_id ASC ";
If (! ($ Result = $ db-> SQL _query ($ SQL )))
{
Message_die (GENERAL_ERROR, 'could not select current user_id ban list', ', _ LINE __, _ FILE __, $ SQL );
}
$ User_list = $ db-> SQL _fetchrowset ($ result );
$ Db-> SQL _freeresult ($ result );
$ Select_userlist = ';
For ($ I = 0; $ I <count ($ user_list); $ I ++)
{
$ Select_userlist. =' '. $ User_list [$ I] ['username'].'';
$ Userban_count ++;
}
If ($ select_userlist = ')
{
$ Select_userlist =' '. $ Lang ['no _ banned_users'].'';
}
$ Select_userlist =' '. $ Select_userlist .'';
$ 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 );
}
$ Banlist = $ db-> SQL _fetchrowset ($ result );
$ Db-> SQL _freeresult ($ result );
$ Select_iplist = ';
$ Select_emaillist = ';
For ($ I = 0; $ I <count ($ banlist); $ I ++)
{
$ Ban_id = $ banlist [$ I] ['ban _ id'];
$ Template-> assign_vars (array (
'L _ UNBAN_USER '=> $ lang ['unban _ username'],
'L _ UNBAN_USER_EXPLAIN '=> $ lang ['unban _ username_explain'],
'L _ UNBAN_IP '=> $ lang ['unban _ IP'],
'L _ UNBAN_IP_EXPLAIN '=> $ lang ['unban _ IP_explain'],
'L _ UNBAN_EMAIL '=> $ lang ['unban _ email'],
'L _ UNBAN_EMAIL_EXPLAIN '=> $ lang ['unban _ email_explain'],
'L _ username' => $ lang ['username'],
'L _ LOOK_UP '=> $ lang ['Look _ up_User'],
'L _ find_username' => $ lang ['find _ username'],
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.