1 | <?php |
||
31 | class InvisibleRecaptcha |
||
32 | { |
||
33 | |||
34 | const URL_GOOGLE_RECAPTCHA_API = 'https://www.google.com/recaptcha/api/siteverify'; |
||
35 | |||
36 | const SESSION_DATA_KEY_RECAPTCHA_PASSED = 'recaptcha_passed'; |
||
37 | |||
38 | /** |
||
39 | * @var EE_Registration_Config $config |
||
40 | */ |
||
41 | private $config; |
||
42 | |||
43 | /** |
||
44 | * @var EE_Session $session |
||
45 | */ |
||
46 | private $session; |
||
47 | |||
48 | /** |
||
49 | * @var boolean $recaptcha_passed |
||
50 | */ |
||
51 | private $recaptcha_passed; |
||
52 | |||
53 | |||
54 | /** |
||
55 | * InvisibleRecaptcha constructor. |
||
56 | * |
||
57 | * @param EE_Registration_Config $registration_config |
||
58 | * @param EE_Session $session |
||
59 | */ |
||
60 | public function __construct(EE_Registration_Config $registration_config, EE_Session $session) |
||
65 | |||
66 | |||
67 | /** |
||
68 | * @return boolean |
||
69 | */ |
||
70 | public function useInvisibleRecaptcha() |
||
74 | |||
75 | |||
76 | /** |
||
77 | * @param array $input_settings |
||
78 | * @return EE_Invisible_Recaptcha_Input |
||
79 | * @throws InvalidDataTypeException |
||
80 | * @throws InvalidInterfaceException |
||
81 | * @throws InvalidArgumentException |
||
82 | * @throws DomainException |
||
83 | */ |
||
84 | public function getInput(array $input_settings = array()) |
||
91 | |||
92 | |||
93 | /** |
||
94 | * @param array $input_settings |
||
95 | * @return string |
||
96 | * @throws EE_Error |
||
97 | * @throws InvalidDataTypeException |
||
98 | * @throws InvalidInterfaceException |
||
99 | * @throws InvalidArgumentException |
||
100 | * @throws DomainException |
||
101 | */ |
||
102 | public function getInputHtml(array $input_settings = array()) |
||
106 | |||
107 | |||
108 | /** |
||
109 | * @param EE_Form_Section_Proper $form |
||
110 | * @param array $input_settings |
||
111 | * @throws EE_Error |
||
112 | * @throws InvalidArgumentException |
||
113 | * @throws InvalidDataTypeException |
||
114 | * @throws InvalidInterfaceException |
||
115 | * @throws DomainException |
||
116 | */ |
||
117 | public function addToFormSection(EE_Form_Section_Proper $form, array $input_settings = array()) |
||
127 | |||
128 | |||
129 | /** |
||
130 | * @param EE_Request $request |
||
131 | * @return boolean |
||
132 | * @throws RuntimeException |
||
133 | */ |
||
134 | public function verifyToken(EE_Request $request) |
||
173 | |||
174 | |||
175 | /** |
||
176 | * @param string $error_response |
||
177 | * @return void |
||
178 | * @throws RuntimeException |
||
179 | */ |
||
180 | public function generateError($error_response = '') |
||
193 | |||
194 | |||
195 | /** |
||
196 | * @param string $error_code |
||
197 | * @return string |
||
198 | */ |
||
199 | public function getErrorCode(&$error_code) |
||
211 | |||
212 | |||
213 | /** |
||
214 | * @return array |
||
215 | * @throws InvalidInterfaceException |
||
216 | * @throws InvalidDataTypeException |
||
217 | * @throws InvalidArgumentException |
||
218 | */ |
||
219 | public function getLocalizedVars() |
||
231 | |||
232 | |||
233 | /** |
||
234 | * @return boolean |
||
235 | * @throws InvalidInterfaceException |
||
236 | * @throws InvalidDataTypeException |
||
237 | * @throws InvalidArgumentException |
||
238 | */ |
||
239 | public function recaptchaPassed() |
||
258 | |||
259 | |||
260 | /** |
||
261 | * @throws InvalidArgumentException |
||
262 | * @throws InvalidDataTypeException |
||
263 | * @throws InvalidInterfaceException |
||
264 | */ |
||
265 | public function setSessionData() |
||
271 | } |
||
272 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.