Rev 1283 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1283 | Rev 1293 | ||
---|---|---|---|
Line 47... | Line 47... | ||
47 | if ($actionID == 'get_challenge') return true; |
47 | if ($actionID == 'get_challenge') return true; |
48 | return parent::csrfUnlock($actionID); |
48 | return parent::csrfUnlock($actionID); |
49 | } |
49 | } |
50 | 50 | ||
51 | /** |
51 | /** |
52 | * @param string $actionID |
- | |
53 | * @param array $params |
52 | * @param array $params |
54 | * @return array |
53 | * @return array |
55 | * @throws OIDplusException |
54 | * @throws OIDplusException |
56 | */ |
55 | */ |
57 | public function action(string $actionID, array $params): array { |
56 | private function action_GetChallenge(array $params): array { |
58 | if ($actionID == 'get_challenge') { |
- | |
59 | $offset = 0; // doesn't matter |
57 | $offset = 0; // doesn't matter |
60 | $min = $offset; |
58 | $min = $offset; |
61 | $max = $offset + OIDplus::baseConfig()->getValue('VTS_CAPTCHA_COMPLEXITY', 50000); |
59 | $max = $offset + OIDplus::baseConfig()->getValue('VTS_CAPTCHA_COMPLEXITY', 50000); |
62 | if ($max > mt_getrandmax()) $max = mt_getrandmax(); |
60 | if ($max > mt_getrandmax()) $max = mt_getrandmax(); |
63 | 61 | ||
Line 77... | Line 75... | ||
77 | "status" => 0, |
75 | "status" => 0, |
78 | "challenge" => $send_to_client, |
76 | "challenge" => $send_to_client, |
79 | // Autosolve on=calculate result on page load; off=calculate result on form submit |
77 | // Autosolve on=calculate result on page load; off=calculate result on form submit |
80 | "autosolve" => OIDplus::baseConfig()->getValue('VTS_CAPTCHA_AUTOSOLVE', true) |
78 | "autosolve" => OIDplus::baseConfig()->getValue('VTS_CAPTCHA_AUTOSOLVE', true) |
81 | ); |
79 | ); |
- | 80 | } |
|
- | 81 | ||
- | 82 | /** |
|
- | 83 | * @param string $actionID |
|
- | 84 | * @param array $params |
|
- | 85 | * @return array |
|
- | 86 | * @throws OIDplusException |
|
- | 87 | */ |
|
- | 88 | public function action(string $actionID, array $params): array { |
|
- | 89 | if ($actionID == 'get_challenge') { |
|
- | 90 | return $this->action_GetChallenge($params); |
|
82 | } else { |
91 | } else { |
83 | return parent::action($actionID, $params); |
92 | return parent::action($actionID, $params); |
84 | } |
93 | } |
85 | } |
94 | } |
86 | 95 |