這幾天一直被廣告留言攻擊,而之前裝的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檢核碼。


Leave a comment