rikcage / yii2-bfp
Brute-force protect in YII2
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2025-03-29 00:38:59 UTC
README
Brute force protect
Install:
php composer.phar require rikcage/yii2-bfp "*"
php yii migrate --migrationPath=vendor/rikcage/yii2-bfp/migrations
Usage:
In conif add
'bfp'=>[
'class'=>'rikcage\bfp\BfpClass',
'params' => [
'accessRoles'=>['admin',], // role for admin page
],
],
Admin url: my.site/bfp/bfp-settings/index
In controller add
use rikcage\bfp\behaviors\BfpBehavior;
public function behaviors()
{
return [
'as BfpClass' => [
'class' => BfpBehavior::className(),
],
];
}
In model add
use rikcage\bfp\behaviors\BfpBehavior;
public function behaviors()
{
$parent_bahaviors = parent::behaviors();
$this_behaviors = [
'as BfpClass' => [
'class' => BfpBehavior::className(),
],
];
return array_merge($parent_bahaviors, $this_behaviors);
}