| 1 |
# Movable Type (r) Open Source (C) 2005-2008 Six Apart, Ltd. |
|---|
| 2 |
# This program is distributed under the terms of the |
|---|
| 3 |
# GNU General Public License, version 2. |
|---|
| 4 |
# |
|---|
| 5 |
# $Id: reCaptcha.pl 1174 2008-01-08 21:02:50Z bchoate $ |
|---|
| 6 |
|
|---|
| 7 |
# reCaptcha plugin for Movable Type |
|---|
| 8 |
# Author: Six Apart (http://www.sixapart.com) |
|---|
| 9 |
# Released under the Artistic and GPLv2 License |
|---|
| 10 |
|
|---|
| 11 |
package MT::Plugin::reCaptcha; |
|---|
| 12 |
|
|---|
| 13 |
use strict; |
|---|
| 14 |
use warnings; |
|---|
| 15 |
|
|---|
| 16 |
use MT; |
|---|
| 17 |
use base qw(MT::Plugin); |
|---|
| 18 |
|
|---|
| 19 |
my $plugin = MT::Plugin::reCaptcha->new({ |
|---|
| 20 |
description => 'CAPTCHA plugin powered by reCaptcha. Follow the instruction specified in README to use reCaptcha on your published blog.', |
|---|
| 21 |
name => 'reCaptcha', |
|---|
| 22 |
author_name => 'Six Apart, Ltd.', |
|---|
| 23 |
author_link => 'http://www.movabletype.com/', |
|---|
| 24 |
blog_config_template => <<TMPL, |
|---|
| 25 |
<dl> |
|---|
| 26 |
<dt>reCaptcha public key</dt> |
|---|
| 27 |
<dd><input name="recaptcha_publickey" size="40" value="<mt:var name="recaptcha_publickey">" /></dd> |
|---|
| 28 |
<dt>reCaptcha private key</dt> |
|---|
| 29 |
<dd><input name="recaptcha_privatekey" size="40" value="<mt:var name="recaptcha_privatekey">" /></dd> |
|---|
| 30 |
</dl> |
|---|
| 31 |
TMPL |
|---|
| 32 |
settings => new MT::PluginSettings([ |
|---|
| 33 |
['recaptcha_publickey', { Scope => 'blog' }], |
|---|
| 34 |
['recaptcha_privatekey', { Scope => 'blog' }], |
|---|
| 35 |
]), |
|---|
| 36 |
version => '0.22', |
|---|
| 37 |
}); |
|---|
| 38 |
|
|---|
| 39 |
MT->add_plugin($plugin); |
|---|
| 40 |
sub instance { $plugin } |
|---|
| 41 |
|
|---|
| 42 |
sub init_registry { |
|---|
| 43 |
my $plugin = shift; |
|---|
| 44 |
$plugin->registry({ |
|---|
| 45 |
'captcha_providers' => { |
|---|
| 46 |
'sixapart_rc' => { |
|---|
| 47 |
'label' => 'reCaptcha', |
|---|
| 48 |
'class' => 'reCaptcha', |
|---|
| 49 |
}, |
|---|
| 50 |
}, |
|---|
| 51 |
}); |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
1; |
|---|