|
5#
樓主 |
發表於 2009-12-27 12:52:10
|
只看該作者
3# coopermaa
好奇驗證為什麼會失敗,我下載了 Discuz! 7.0 的 source 來看。找到丟出 "驗證問答回答錯誤,無法提交" 訊息的 code,有兩個地方:
1. ajax.php L93:
- } elseif($action == 'checksecanswer') {
- if($seclevel) {
- $tmp = $seccode;
- } else {
- list($tmp, $expiration, $seccodeuid) = explode("\t", authcode($_DCOOKIE['secq'], 'DECODE'));
- if($seccodeuid != $discuz_uid || $timestamp - $expiration > 600) {
- showmessage('submit_secqaa_invalid');
- }
- }
- require_once DISCUZ_ROOT.'./forumdata/cache/cache_secqaa.php';
- !$headercharset && @dheader('Content-Type: text/html; charset='.$charset);
- if(md5($secanswer) != $_DCACHE['secqaa'][substr($tmp, 0, 1)]['answer']) {
- showmessage('submit_secqaa_invalid');
- }
- showmessage('succeed');
複製代碼
2. global.func.php L1197 & L1203:
- if($secqaacheck) {
- if(!$seclevel) {
- list($seccode, $expiration, $seccodeuid) = explode("\t", authcode($_DCOOKIE['secq'], 'DECODE'));
- if($seccodeuid != $discuz_uid || $timestamp - $expiration > 600) {
- showmessage('submit_secqaa_invalid');
- }
- dsetcookie('secq', '');
- }
- require_once DISCUZ_ROOT.'./forumdata/cache/cache_secqaa.php';
- if(md5($secanswer) != $_DCACHE['secqaa'][substr($seccode, 0, 1)]['answer']) {
- showmessage('submit_secqaa_invalid');
- }
- $seclevel && $seccode = random(1, 1) * 1000000 + substr($seccode, -6);
複製代碼
showmessage('submit_secqaa_invalid') 就是丟出 "驗證問答回答錯誤,無法提交" 的來源...
接下來就要靠站長了... :D 從這兩個地方下手 debug,應該是可以找出問題
ps: 也許跟 cookie 有關吧 |
|