|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace jumper423\decaptcha\services; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class RuCaptchaReCaptcha. |
|
7
|
|
|
*/ |
|
8
|
|
|
class RuCaptchaReCaptcha extends RuCaptcha |
|
9
|
|
|
{ |
|
10
|
|
|
const ACTION_FIELD_GOOGLEKEY = 19; |
|
11
|
|
|
const ACTION_FIELD_PROXY = 20; |
|
12
|
|
|
const ACTION_FIELD_PROXYTYPE = 21; |
|
13
|
|
|
const ACTION_FIELD_PAGEURL = 22; |
|
14
|
|
|
|
|
15
|
|
|
public function init() |
|
16
|
|
|
{ |
|
17
|
|
|
parent::init(); |
|
18
|
|
|
|
|
19
|
|
|
$this->paramsNames[static::ACTION_FIELD_GOOGLEKEY] = 'googlekey'; |
|
20
|
|
|
$this->paramsNames[static::ACTION_FIELD_PROXY] = 'proxy'; |
|
21
|
|
|
$this->paramsNames[static::ACTION_FIELD_PROXYTYPE] = 'proxytype'; |
|
22
|
|
|
$this->paramsNames[static::ACTION_FIELD_PAGEURL] = 'pageurl'; |
|
23
|
|
|
|
|
24
|
|
|
$this->actions[static::ACTION_RECOGNIZE][static::ACTION_FIELDS][static::ACTION_FIELD_METHOD][static::PARAM_SLUG_DEFAULT] = 'userrecaptcha'; |
|
25
|
|
|
$this->actions[static::ACTION_RECOGNIZE][static::ACTION_FIELDS][static::ACTION_FIELD_GOOGLEKEY] = [ |
|
26
|
|
|
static::PARAM_SLUG_REQUIRE => true, |
|
27
|
|
|
static::PARAM_SLUG_TYPE => static::PARAM_FIELD_TYPE_STRING, |
|
28
|
|
|
]; |
|
29
|
|
|
$this->actions[static::ACTION_RECOGNIZE][static::ACTION_FIELDS][static::ACTION_FIELD_PROXY] = [ |
|
30
|
|
|
static::PARAM_SLUG_TYPE => static::PARAM_FIELD_TYPE_STRING, |
|
31
|
|
|
]; |
|
32
|
|
|
$this->actions[static::ACTION_RECOGNIZE][static::ACTION_FIELDS][static::ACTION_FIELD_PROXYTYPE] = [ |
|
33
|
|
|
static::PARAM_SLUG_TYPE => static::PARAM_FIELD_TYPE_STRING, |
|
34
|
|
|
]; |
|
35
|
|
|
$this->actions[static::ACTION_RECOGNIZE][static::ACTION_FIELDS][static::ACTION_FIELD_PAGEURL] = [ |
|
36
|
|
|
static::PARAM_SLUG_REQUIRE => true, |
|
37
|
|
|
static::PARAM_SLUG_TYPE => static::PARAM_FIELD_TYPE_STRING, |
|
38
|
|
|
]; |
|
39
|
|
|
$this->actions[static::ACTION_RECOGNIZE][static::ACTION_FIELDS][static::ACTION_FIELD_FILE][static::PARAM_SLUG_REQUIRE] = false; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function recognize($additionally = [], $null = null) |
|
43
|
|
|
{ |
|
44
|
|
|
return parent::recognize(null, $additionally); |
|
45
|
|
|
} |
|
46
|
|
|
} |
|
47
|
|
|
|