From c9a9b7d315943dbcf4aff336add8392e990e7da4 Mon Sep 17 00:00:00 2001 From: Matthias Tarasiewicz Date: Tue, 13 Feb 2007 13:27:54 +0000 Subject: [PATCH] adding the form_spam_protection plugin that was missing from the last commit --- vendor/plugins/form_spam_protection/README | 32 ++++ vendor/plugins/form_spam_protection/Rakefile | 22 +++ vendor/plugins/form_spam_protection/init.rb | 4 + .../plugins/form_spam_protection/install.rb | 1 + .../lib/form_spam_protection.rb | 36 +++++ .../lib/form_tag_helper_extensions.rb | 56 +++++++ .../tasks/form_spam_protection_tasks.rake | 4 + .../test/form_spam_protection_test.rb | 39 +++++ .../test/mocks/enkoder.rb | 14 ++ .../form_spam_protection/test/test_helper.rb | 30 ++++ .../plugins/form_spam_protection/uninstall.rb | 1 + .../vendor/enkoder/LICENSE | 27 ++++ .../vendor/enkoder/README | 82 ++++++++++ .../vendor/enkoder/init.rb | 1 + .../vendor/enkoder/lib/enkoder.rb | 144 ++++++++++++++++++ 15 files changed, 493 insertions(+) create mode 100644 vendor/plugins/form_spam_protection/README create mode 100644 vendor/plugins/form_spam_protection/Rakefile create mode 100644 vendor/plugins/form_spam_protection/init.rb create mode 100644 vendor/plugins/form_spam_protection/install.rb create mode 100644 vendor/plugins/form_spam_protection/lib/form_spam_protection.rb create mode 100644 vendor/plugins/form_spam_protection/lib/form_tag_helper_extensions.rb create mode 100644 vendor/plugins/form_spam_protection/tasks/form_spam_protection_tasks.rake create mode 100644 vendor/plugins/form_spam_protection/test/form_spam_protection_test.rb create mode 100644 vendor/plugins/form_spam_protection/test/mocks/enkoder.rb create mode 100644 vendor/plugins/form_spam_protection/test/test_helper.rb create mode 100644 vendor/plugins/form_spam_protection/uninstall.rb create mode 100644 vendor/plugins/form_spam_protection/vendor/enkoder/LICENSE create mode 100644 vendor/plugins/form_spam_protection/vendor/enkoder/README create mode 100644 vendor/plugins/form_spam_protection/vendor/enkoder/init.rb create mode 100644 vendor/plugins/form_spam_protection/vendor/enkoder/lib/enkoder.rb diff --git a/vendor/plugins/form_spam_protection/README b/vendor/plugins/form_spam_protection/README new file mode 100644 index 00000000..1b0ce210 --- /dev/null +++ b/vendor/plugins/form_spam_protection/README @@ -0,0 +1,32 @@ +FormSpamProtection +================== + +Tired of forms in your web application getting spammed? Captcha works but is a +pain. This plugin ensures a real person is submitting the form without +requiring anything from the user except that they have Javascript turned on. + +This plugin uses the Hivelogic Enkoder, normally used to protect spambots from +harvesting e-mail addresses, to enkode a hidden field on the form. That field +is required when the user submits the form or they get an error. + +To install: + ./script/plugin install -x http://form-spam-protection.googlecode.com/svn/form_spam_protection/ + +To use: In your controller, just add: + protect_forms_from_spam + +You can also specify :only or :except just like a before filter: + protect_forms_from_spam :only => :index + +In fact, it is just a before filter. To protect only the form in one action +and the handling (but not the form) in another, do this: + before_filter :protect_form_from_spam, :only => :new + before_filter :protect_form_handler_from_spam, :only => :create +...though this is seldom necessary. + +Bugs: +Please submit bugs through the tracker at http://code.google.com/p/form-spam-protection/issues/list + +TODO: +* Add