| 1 |
liveuser |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*
|
|
|
4 |
|
|
|
5 |
QBPWCF, Quick Build PHP website Component base on Fedora Linux.
|
|
|
6 |
Copyright (C) 2015~2021 Min-Jhin,Chen
|
|
|
7 |
|
|
|
8 |
This file is part of QBPWCF.
|
|
|
9 |
|
|
|
10 |
QBPWCF is free software: you can redistribute it and/or modify
|
|
|
11 |
it under the terms of the GNU General Public License as published by
|
|
|
12 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
13 |
(at your option) any later version.
|
|
|
14 |
|
|
|
15 |
QBPWCF is distributed in the hope that it will be useful,
|
|
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
18 |
GNU General Public License for more details.
|
|
|
19 |
|
|
|
20 |
You should have received a copy of the GNU General Public License
|
|
|
21 |
along with QBPWCF. If not, see <http://www.gnu.org/licenses/>.
|
|
|
22 |
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
#使用命名空間qbpwcf
|
|
|
26 |
namespace qbpwcf;
|
|
|
27 |
|
| 952 |
liveuser |
28 |
#以該檔案的實際位置的 lib path 為 include path 首位
|
|
|
29 |
exec("cd ".pathinfo(__FILE__)["dirname"]."/../../".$folderOfUsrLib.";pwd;",$output,$status);
|
|
|
30 |
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
|
|
|
31 |
|
| 1 |
liveuser |
32 |
#匯入外部套件
|
| 952 |
liveuser |
33 |
include("allInOneForSOAP.php");
|
| 1 |
liveuser |
34 |
|
|
|
35 |
#函式說明:
|
|
|
36 |
#驗證 google reCAPTCH 回傳的驗證碼,當有post的response,key,val時,會進行處理.
|
|
|
37 |
#回傳結果:
|
|
|
38 |
#$result["status"],執行正常與否,"false"代表不正常;"true"代表正常.
|
|
|
39 |
#$result["error"],錯誤訊息陣列.
|
|
|
40 |
#$result["content"],語法.
|
|
|
41 |
#$result["function"],函式名稱.
|
|
|
42 |
#$result["passed"],"true"代表通過驗證,"false"代表沒有通過驗證.
|
|
|
43 |
#必填參數:
|
|
|
44 |
#$conf["secret"],字串,recaptcha 上對應 site 的 secret.
|
| 952 |
liveuser |
45 |
$conf["secret"]=googleReCAPTCHAsecret;
|
| 1 |
liveuser |
46 |
#$conf["fileArgu"],字串,__FILE__的內容.
|
|
|
47 |
$conf["fileArgu"]=__FILE__;
|
|
|
48 |
#可省略參數:
|
|
|
49 |
#無
|
|
|
50 |
#參考資料:
|
|
|
51 |
#https://developers.google.com/recaptcha/docs/verify
|
|
|
52 |
$gl_reCAPTCHA_server=authenticate::gl_reCAPTCHA_server($conf);
|
|
|
53 |
unset($conf);
|
|
|
54 |
|
|
|
55 |
#印出結果
|
|
|
56 |
echo json_encode($gl_reCAPTCHA_server);
|
|
|
57 |
|
|
|
58 |
?>
|