Security Code Plug-in installed successfully

| 2 Comments | 5 TrackBacks

终于安装成功了,花了超过5个小时。下面把自己安装的过程简述一下,做一记录,供有相同或类似经历的朋友参考:
我的平台是:

Windows server2003
IIS
Movable type 3.121
ActivePerl 5.8

最初是在Learning Movable Type上看到的Concerning Spam,就想安装anti-spam工具,试过MT-Blacklist,怎么也装不好。
最后看到Security Code的方法,决定试试。
参考了给MT加上防范发广告机器人的校验码 安装Scode.
还参考了廣告章魚與安全碼
安装GD模块。

step1: 参考了〔廣告章魚與安全碼〕
GD Perl 模块安装。

ppm> install GD

ppm> rep add NewRepSite http://theoryx5.uwinnipeg.ca/ppms/

ppm> search GD

ppm> install GD

Step2:参考了〔给MT加上防范发广告机器人的校验码〕
1)下载SCode plugin,解压缩;

2)编辑解压缩后的SCode.pm,修改my $tmpdir为您服务器的暂存目录,my $scode_length为校验码长度,my $scode_maxtmp为最多同时能够产生多少个校验吗,默认为50,若您的Blog访问人数较多,请适当调整此值;
暂存目录要可读写 例如:c:/website/mt/tmp/

3)修改mt-scode.cgi,$c_background、$c_border、$c_line、$c_code可以设置校验码的颜色;

4)将SCode.pm上传到MT安装目录的lib/MT/目录,scode.pl到plugins/目录,mt-scode.cgi到根目录,并修改mt-scode.cgi属性为可执行;

5)打开lib/MT/App/Comments.pm,找到

if (!$q->param('text')) {
return $app->handle_error($app->translate("Comment text is required."));
}
在后面加上
#
# SecurityCode hack start
#
require MT::SCode;
my $code = $q->param('code');
my $scode = $q->param('scode');
my $sscode = MT::SCode::scode_get($code);
if ($scode ne $sscode) {
return $app->handle_error($app->translate(
"Wrong or missing Security Code."));
}
MT::SCode::scode_delete($code);
MT::SCode::scode_create($code);
#
# Security hack ends
#

6)打开lib/MT/Template/Context.pm,查找_hdlr_comment_fields子函数,

sub _hdlr_comment_fields { my ($ctx, $args, $cond) = @_;

在其后添加
# Security code validation
srand int (time/10)+$$;
my $securitycode = int rand(MT::SCode::scode_tmp()); $securitycode++;
MT::SCode::scode_create($securitycode);
# End Security code hack

再查找两处

<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 -->

7)编辑Individual Entry Archive,在

<label for="url">URL</label><br />
<input tabindex="3" id="url" name="url" /><br /><br />
即评论的网页地址输入下面加上

<!-- Security Code Check --> <label for="scode">SCode:</label><br /> <input type="hidden" id="code" name="code" value="<$MTSecurityCode$>" /> <img border="0" src="<$MTCGIPath$><$MTSecurityImage$>?code=<$MTSecurityCode$>"><br /> <input tabindex=3 id="scode" name="scode" /><br /><br /> <!-- end of Security Code Check -->

8)重建您的Blog,校验码就出现了,可以有效防止评论机器人滥发垃圾留言裝

5 TrackBacks

我在先前 Blog 了一篇『已經安裝 MT-Blacklist』的文章,對於 MT 的 Spammer 來說,Blacklist 應該是沒有辦法防止它們的,由於針對 domain 過濾,一些新的 Spammer 竄起,List 速度總是比不上它們。最近çœ... Read More

So I've just implemented the SCODE anti-comment-spam plugin for MovableType. To get the correct libraries, use the ppm install app which comes with ActivePerl and the following commands: ppm> rep add UWinnipeg http://theoryx5.uwinnipeg.ca/ppms/ ppm> se... Read More

To serve the net friend Niklas only know English. Now I want to post the english version of how to install the Security Code Plugin. My platform: Windows server2003 IIS Movable type 3.121 ActivePerl 5.8... Read More

Scode upgraded from David Yin's BLOG on June 9, 2005 4:23 PM

Upgrade Scode 0.1.5 to Scode0.1c Details as below: Download Scode from it site Almost same as my Security Code Plug-in installed successfully Only a little difference. In step 2, 6) Open lib/MT/Template/Context.pm Change the code following Scode's read... Read More

So I've just implemented the SCODE anti-comment-spam plugin for MovableType. To get the correct libraries, use the ppm install app which comes with ActivePerl and the following commands: ppm> rep add UWinnipeg http://theoryx5.uwinnipeg.ca/ppms/ ppm> se... Read More

2 Comments

看看是不是真的可以用Scode校验码。

Could you translate this to English please? All I see is ????

Thanks

Niklas

Leave a comment

关于作者

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.01

About this Entry

This page contains a single entry by David Yin published on November 7, 2004 11:53 AM.

今天安装了CRYPT:DSA 模块 was the previous entry in this blog.

宁在人前全不会,莫在人前会不全 is the next entry in this blog.

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

Online Tools

Code Convertor
Add to Technorati Favorites