MT3.1x留言檢核碼安裝

這幾天一直被廣告留言攻擊,而之前裝的Blacklist也似乎沒多大用處了,因此決定安裝數字檢核碼,找到罐頭文章中的防制發廣告機器人的檢核碼,依照上面的步驟便開始安裝,需要注意的事項:
1.在罐頭文章中的第六項,已安裝mt-Blacklist,還是需要改lib/MT/App/Comments.pm,而不是extlib/jayallen /MTBlPost.pm這個檔案。
2.打開lib/MT/Template/Context.pm,尋找_hdlr_comment_fields字串,在
sub _hdlr_comment_fields {
my ($ctx, $args, $cond) = @_;
後面加上:

# Security code validation
require MT::SCode; # <-- new addition
srand int (time/10)+$$;
my $securitycode = int rand(MT::SCode::scode_tmp());
$securitycode++;
MT::SCode::scode_create($securitycode);
# End Security code hack

3.之後往下拉,找到<MT_TRANS phrase="Remember me?">

<input type="radio" id="remember" name="bakecookie" />
,再加入:
<!-- Security Code Check -->

<input type="hidden" id="code" name="code" value="$securitycode" />

<label for="scode">Security Code:</label><br />

<img border="0" alt="Please enter the security code you see here" src="$path/mt-scode.cgi?code=$securitycode" /><br />

<input tabindex="3" id="scode" name="scode" /><br /><br />

<!-- end of Security Code Check -->

4.再往下移動一點,找到<MT_TRANS phrase="Remember me?">

<input type="radio" id="remember" name="bakecookie" />
,加入:
<!-- Security Code Check -->

<input type="hidden" id="code" name="code" value="$securitycode" />

<label for="scode">Security Code:</label><br />

<img border="0" alt="Please enter the security code you see here" src="$path/mt-scode.cgi?code=$securitycode" /><br />

<input tabindex="3" id="scode" name="scode" /><br /><br />

<!-- end of Security Code Check -->

就完成在已安裝mt-Blacklist 2.04的MT3.1x上安裝Scode檢核碼。

March 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Archives

Powered by Movable Type 4.33-en

About this Entry

This page contains a single entry by philipz published on June 10, 2005 8:35 AM.

Find recent content on the main index or look in the archives to find all content.