MODULE
-----------------------------------------------------------------------------
<?php
/**
* 2024 Free
*
* NOTICE OF LICENSE
*
*
* @author free
* @copyright 2024 free
* @license This is free addon but you can share, not sell it
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class antibothoney extends Module
{
public function __construct()
{
$this->name = 'antibothoney';
$this->author = 'freeeee';
$this->version = '1.0.0';
$this->need_instance = 0;
$this->bootstrap = true;
$this->tab = 'others';
parent::__construct();
$this->displayName = $this->trans('User verification', [], 'Modules.Antibothoney.Admin');
$this->ps_versions_compliancy = array(
'min' => '1.7',
'max' => _PS_VERSION_
);
$this->description = $this->trans('Check user before registration and block bot account', [], 'Modules.Antibothoney.Admin');
}
/**
* Install module
*
* @return bool true if success
*/
public function install()
{
if (Shop::isFeatureActive()) {
Shop::setContext(Shop::CONTEXT_ALL);
}
if (!parent::install()
|| !$this->registerHook('actionSubmitAccountBefore')
) {
return false;
}
return true;
}
public function uninstall()
{
return parent::uninstall();
}
public function isUsingNewTranslationSystem()
{
return true;
}
public function hookActionSubmitAccountBefore()
{
if (Tools::getIsset('id_gender')) {
Tools::redirect('/');
}
return true;
}
}
-------------------------------------------------------------------------------------
I'm on the right way???????