[BETA] MOD Admin_restrict_IP

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

[BETA] MOD Admin_restrict_IP

Post by Merlin Sythove »

This mod restricts the ADMIN to a single hard coded IP address. This gives extra safety because even if a hacker had your name and password, they could not get in unless they have your IP as well.
But at the expense of not being able to do Admin work from another IP address of course.

Code: Select all

############################################################## 
## MOD Title: MOD Admin_restrict_IP
## MOD Author: Merlin Sythove < Merlin@silvercircle.org > 
## MOD Description: Restricts admin to 1 IP address only
## MOD Version: 1.0.0 
## 
## Installation Level: (Easy) 
## Installation Time: 1 Minutes 
## Files To Edit: /admin/pagestart.php
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## 
############################################################## 
## MOD History: 
## 
##   2005/11/28 Released
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 


# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/pagestart.php

# 
#-----[ FIND ]------------------------------------------ 
# 
if (empty($no_page_header))

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
//START MOD Admin_restrict_ip
echo $user_ip; //Use this to get the IP in the first place
if ($user_ip <> '12345') //Paste IP here
{ 
	message_die(GENERAL_ERROR, "Hacking attempt!"); 
}
//END MOD Admin_restrict_ip

#
# ---- [ INSTRUCTIONS ] -------------------------------------------------------
#
# The first time the IP will be shown as soon as you try to enter the Admin panel,
# and the page will show "Hacking attempt" (plus some other warnings, ignore those).
# Copy the IP address that is shown on screen, it is yours.
# Paste the IP address in the code above, instead of 12345, and change
#    echo $user_ip; //Use this to get the IP in the first place
# to
#    //echo $user_ip; //Use this to get the IP in the first place
#
# Remember: you cannot log in as admin from another IP address now (like work,
# holiday, at a friend, if you use a telephone modem). You must use FTP to get
# the file and change the code in order to log in from another IP.

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
agent00shoe
Registered User
Posts: 373
Joined: Sat Feb 12, 2005 9:39 pm

Post by agent00shoe »

Good idea. If I didn't have a dynamic IP, I'd use this.
Post Reply

Return to “[2.0.x] MODs in Development”