pixmicat

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/Modules/mod_recaptcha/ @ 563  →  /Modules/mod_recaptcha/ @ 564
/Modules/mod_recaptcha/howto.txt
@@ -16,5 +16,5 @@
0. Please sign up for a FREE account of reCAPTCHA. (http://recaptcha.net/whyrecaptcha.html) And you can get two 40-letter-long keys.
1. Download the "recaptchalib.php" from http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest
2. Put the following files into the module/ directory: "mod_recaptcha.php" and "recaptchalib.php."
3. Use your favorite editor to open the "mod_recaptcha.php" and fill out the public key and the private key which are gotton at step 0.
3. Use your favorite editor to open the "mod_recaptcha.php" and fill out the public key and the private key you got at step 0.
4. Finally, open the "config.php" and add one line ($ModuleList[] = 'mod_recaptcha';) into the "Modules to be loaded" block.
/Modules/mod_recaptcha/mod_recaptcha.php
@@ -13,24 +13,20 @@
}
 
function getModuleName(){
return 'mod_recaptcha';
return 'mod_recaptcha : reCAPTCHA 驗證圖像機制';
}
 
function getModuleVersionInfo(){
return 'reCAPTCHA 驗證圖像機制 v070713';
return '4th.Release.2 (v071111)';
}
 
/* 在頁面附加 reCAPTCHA 圖像和功能 */
function autoHookPostForm(&$txt){
global $recaptcha_api_server;
$recaptcha_api_server = 'http://api.recaptcha.net';
$txt .= '<tr><th class="Form_bg">驗證碼</th><td>'.recaptcha_get_html($this->KEY_PUBLIC)."<small>(大小寫和符號需留意,兩個文字間用空白分隔)</small></td></tr>\n";
}
 
/* 在接收到送出要求後馬上檢查是否正確 */
function autoHookRegistBegin(&$name, &$email, &$sub, &$com, $upfileInfo, $accessInfo){
global $recaptcha_verify_server;
$recaptcha_verify_server = 'api-verify.recaptcha.net';
$resp = recaptcha_check_answer($this->KEY_PRIVATE, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);
if(!$resp->is_valid){ error('reCAPTCHA 驗證碼錯誤!除大小寫須注意之外,標點符號及兩個單字都需輸入 (以空白分隔)'); } // 檢查
}