PHP Classes

Firewall Protection: Restrict the access to pages based on IP address

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 44%Total: 734 All time: 4,552 This week: 455Up
Version License PHP version Categories
firewall-protection 0.7GNU Lesser Genera...5.0HTTP, PHP 5, Security
Description 

Author

This class can be used to restrict the access to pages based on IP address.

It can check if the IP address of the user computer and compares it to ranges of allowed and forbidden IP addresses.

If the IP address is not in the list of allowed addresses or is in the list in forbidden address, the class throws an exception.

The lists of allowed and forbidden addresses may be defined programmatically or read from a configuration file in XML format.

The class also gives you oppertunity for XXS filtering and SQL injection escaping at a global level so you can be 100% safe and you do not need to escape any data in your script.

Now you also can block all input, this is most not nessecary, but it can be used for emergency and when site is down or if you are just showing static page.

Picture of Petter Kjelkenes
Name: Petter Kjelkenes <contact>
Classes: 9 packages by
Country: Norway Norway
Age: 35
All time rank: 5522 in Norway Norway
Week rank: 273 Up1 in Norway Norway Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files (4)  
File Role Description
Plain text file firewall.class.php Class The firewall class source
Accessible without login Plain text file example.configscript.php Example Config loaded firewall example!
Accessible without login Plain text file example.firewall.php Example Example usage
Accessible without login Plain text file firewallconfig.xml Data Config script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:734
This week:0
All time:4,552
This week:455Up
User Ratings User Comments (1)
 All time
Utility:58%StarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:44%StarStarStar
Rank:3513
 
Flawed by design.
14 years ago (Artur Graniszewski)
27%StarStar