Topic: Building a whitelist into register.php?
I want to build in a whitelist into register.php for a particular forum, so that while the forum itself may remain accessible to the world, registration is limited to people who come in from a specified set of IP addresses.
I could easily achieve this outside of FluxBB by adding this to the .htaccess file in the Fluxbb forum root:
<Files register.php>
order allow, deny
allow from 123.456.789.0/16
allow from 222.222.222.222
allow from 333.333.333.333
ErrorDocument 403 "'Sorry, we blocked you, but if you think
this was in error contact the admin at admin@myforums.com."
</Files>While this is simple and does the job, I would like to see if the same thing could be achieved within register.php, since using .htaccess isn't always ideal.
Is there a way to do so that is as simple as the .htaccess route?
Requirements would include:
- providing a error message to blocked potential registrants;
- the code should be able to handle netmasks like 10.1.0.0/255.255.0.0 and CIDR.
All help appreciated.