How to use KeepOut table
Starting with L* 7.0.0 there is a table keepout created in the database.
You can handle this table within your own addons, via a code2 section or via GUI Admintool KeepOut.
With the use of this table you are enabled to block unwanted emails, ip-adresses or referrer in quickform forms or during signup process in your LEPTON installation.
Just follow first instructions after you entered some values in the keepout core table.
Usage during Signup Process
First create a signup2 page (use a copy of account/signup2), place it in your frontend-template folder /frontend/login/ and use following code for a first test
- echo(LEPTON_tools::display($_POST,'pre','ui positive message'));
- $test = LEPTON_core::check_entry($_POST['email']);
- if($test === false)
- {
- echo (LEPTON_tools::display('Welcome','pre','ui positive message'));
- }
- if($test === true)
- {
- echo (LEPTON_tools::display('blocked','pre','ui negative message'));
- }
- die(LEPTON_tools::display($_POST['email'],'pre','ui purple message'));
Using in Quickform
Create a file quickform_custom_frontend in modules/quickform/classes and use following code for a first test:
- class quickform_custom_frontend extends quickform
- {
- public static $instance;
- public function initialize()
- {
- $this->block_entry();
- }
- public function block_entry()
- {
- if(isset($_POST['timestamp']))
- {
- // check values
- $ip = LEPTON_core::check_entry($_SERVER['SERVER_ADDR']);
- $mail = LEPTON_core::check_entry($_POST['email']);
- if($ip === true || $mail === true)
- {
- die('blocked');
- }
- else
- {
- die('welcome');
- }
- }
- }
- }
In every case it is possible to handle the checks in that way you want.
Use the custom files to create the reaction of your needs.
Notice: if you use addon signup you don't have to do anything. Handling keepout is completely implemented in signup > 1.4.0.
If you don't like the standard handling you simply have to copy the file keepout.php, rename the copy to keepout_custom.php and edit the handling to your needs.
For any further questions please use the forum.