Rev 1149 | Rev 1181 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1149 | Rev 1162 | ||
---|---|---|---|
Line 120... | Line 120... | ||
120 | $captcha_success=@json_decode($verify); |
120 | $captcha_success=@json_decode($verify); |
121 | $SCORE_THRESHOLD = 0.5; // TODO: Make Score configurable (only V3) |
121 | $SCORE_THRESHOLD = 0.5; // TODO: Make Score configurable (only V3) |
122 | if (!$captcha_success) { |
122 | if (!$captcha_success) { |
123 | throw new OIDplusException(_L('CAPTCHA not successfully verified').' ('._L('JSON Decode failed').')'); |
123 | throw new OIDplusException(_L('CAPTCHA not successfully verified').' ('._L('JSON Decode failed').')'); |
124 | } |
124 | } |
125 | if ($captcha_success->success==false) { |
125 | if (!$captcha_success->success) { |
126 | throw new OIDplusException(_L('CAPTCHA not successfully verified').' ('._L('Failed').')'); |
126 | throw new OIDplusException(_L('CAPTCHA not successfully verified').' ('._L('Failed').')'); |
127 | } |
127 | } |
128 | if (isset($captcha_success->score) && ($captcha_success->score < $SCORE_THRESHOLD)) { |
128 | if (isset($captcha_success->score) && ($captcha_success->score < $SCORE_THRESHOLD)) { |
129 | throw new OIDplusException(_L('CAPTCHA not successfully verified').' ('._L('Score %1 too low', $captcha_success->score).')'); |
129 | throw new OIDplusException(_L('CAPTCHA not successfully verified').' ('._L('Score %1 too low', $captcha_success->score).')'); |
130 | } |
130 | } |