-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.php
More file actions
82 lines (76 loc) · 2.09 KB
/
Copy pathPlugin.php
File metadata and controls
82 lines (76 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php namespace RainLab\Recaptcha;
use Validator;
use System\Classes\PluginBase;
use System\Classes\SettingsManager;
use RainLab\Recaptcha\Validators\RecaptchaValidator;
/**
* Recaptcha Plugin Information File
*
* @package rainlab\recaptcha
* @author Alexey Bobkov, Samuel Georges
*/
class Plugin extends PluginBase
{
/**
* pluginDetails about this plugin.
*/
public function pluginDetails()
{
return [
'name' => 'reCAPTCHA',
'description' => 'Protects website forms using the Google reCAPTCHA service.',
'author' => 'October CMS',
'icon' => 'icon-shield',
'homepage' => 'https://github.com/rainlab/recaptcha-plugin'
];
}
/**
* boot method, called right before the request route.
*/
public function boot()
{
Validator::extend(
'recaptcha',
RecaptchaValidator::class . '@validate',
__('The reCAPTCHA verification failed. Please try again.')
);
}
/**
* registerComponents used by the frontend.
*/
public function registerComponents()
{
return [
\RainLab\Recaptcha\Components\Recaptcha::class => 'recaptcha'
];
}
/**
* registerSettings used by the backend.
*/
public function registerSettings()
{
return [
'recaptcha' => [
'label' => 'reCAPTCHA',
'description' => 'Manage Google reCAPTCHA configuration.',
'category' => SettingsManager::CATEGORY_SYSTEM,
'icon' => 'icon-shield',
'class' => \RainLab\Recaptcha\Models\Settings::class,
'order' => 500,
'permissions' => ['rainlab.recaptcha.access_settings']
]
];
}
/**
* registerPermissions used by the backend.
*/
public function registerPermissions()
{
return [
'rainlab.recaptcha.access_settings' => [
'tab' => 'reCAPTCHA',
'label' => 'Manage reCAPTCHA settings'
]
];
}
}