-
-
Notifications
You must be signed in to change notification settings - Fork 994
Expand file tree
/
Copy pathplugin_interface.php
More file actions
126 lines (110 loc) · 2.69 KB
/
plugin_interface.php
File metadata and controls
126 lines (110 loc) · 2.69 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\captcha\plugins;
interface plugin_interface
{
/**
* Check if the plugin is available
*
* @return bool True if the plugin is available, false if not
*/
public function is_available(): bool;
/**
* Check if the plugin has a configuration
*
* @return bool True if the plugin has a configuration, false if not
*/
public function has_config(): bool;
/**
* Get the name of the plugin, should be language variable
*
* @return string
*/
public function get_name(): string;
/**
* Set the service name of the plugin
*
* @param string $name
*/
public function set_name(string $name): void;
/**
* Display the captcha for the specified type
*
* @param confirm_type $type Type of captcha, should be one of the CONFIRMATION_* constants
* @return void
*/
public function init(confirm_type $type): void;
/**
* Get hidden form fields for this captcha plugin
*
* @return array Hidden form fields
*/
public function get_hidden_fields(): array;
/**
* Validate the captcha with the given request data
*
* @return bool True if request data was valid captcha reply, false if not
*/
public function validate(): bool;
/**
* Get error string from captcha
*
* @return string Error string, empty string if there is no error
*/
public function get_error(): string;
/**
* Return whether captcha was solved
*
* @return bool True if captcha was solved, false if not
*/
public function is_solved(): bool;
/**
* Reset captcha state, e.g. after checking if it's valid
*
* @return void
*/
public function reset(): void;
/**
* Get attempt count for this captcha and user
*
* @return int Number of attempts
*/
public function get_attempt_count(): int;
/**
* Get template filename for captcha
*
* @return string Template file name
*/
public function get_template(): string;
/**
* Get template filename for demo
*
* @return string Demo template file name
*/
public function get_demo_template(): string;
/**
* Garbage collect captcha plugin
*
* @param confirm_type $confirm_type Confirm type to garbage collect, defaults to all (0)
* @return void
*/
public function garbage_collect(confirm_type $confirm_type = confirm_type::UNDEFINED): void;
/**
* Display acp page
*
* @param mixed $id ACP module id
* @param mixed $module ACP module name
* @return void
*/
public function acp_page(mixed $id, mixed $module): void;
}