Anti-spam module for Kohana
The other day, it was necessary for one project, on the Kohana framework, to tighten the protection of forms from filling with spam bots.
There were no ready-made modules, but I did not want to bother users with captcha input.
Therefore, it was decided to search the library for ready-made libraries or techniques to combat spam. And the Botobor library was found ( habrahabr.ru/post/135209 ), written by the user Mekras .
Before that, I had never had to write modules for Kohana, so it was an opportunity to slightly increase my knowledge.
Here is the result of github.com/evgentus/antispam
Installing this module is no different from installing any other module.
Copy all the files to modules / antispam /, configure the config, add the module to application / bootstrap.php
In the config, all parameters are documented in detail.
In order to “prepare” the form for the bot, you need to do this:
In order to check the form, you need to do this:
The Botobor library has been slightly rewritten for ease of configuration.
If anyone has ideas or links to methods for detecting and combating spam, leave them in the comments, try to add them to this module.
This module is designed to filter out "simple" spam bots, but it will not save you from those who intentionally want to spam your resource.
All the details in the theme of Botobor'a ( habrahabr.ru/post/135209 )
There were no ready-made modules, but I did not want to bother users with captcha input.
Therefore, it was decided to search the library for ready-made libraries or techniques to combat spam. And the Botobor library was found ( habrahabr.ru/post/135209 ), written by the user Mekras .
Before that, I had never had to write modules for Kohana, so it was an opportunity to slightly increase my knowledge.
Here is the result of github.com/evgentus/antispam
Installation
Installing this module is no different from installing any other module.
Copy all the files to modules / antispam /, configure the config, add the module to application / bootstrap.php
Config
In the config, all parameters are documented in detail.
A bit of demo code
In order to “prepare” the form for the bot, you need to do this:
getForm(); // Подготовка формы для ботов
echo $form; // Ваш способ показа формы
?>
In order to check the form, you need to do this:
isHuman()){ // Проверка на "человечность"
echo 'Форма заполнена человеком';
}
else{
echo 'Форма заполнена ботом';
}
?>
Finally
The Botobor library has been slightly rewritten for ease of configuration.
If anyone has ideas or links to methods for detecting and combating spam, leave them in the comments, try to add them to this module.
This module is designed to filter out "simple" spam bots, but it will not save you from those who intentionally want to spam your resource.
All the details in the theme of Botobor'a ( habrahabr.ru/post/135209 )