2010-06-10 04:31:06 +02:00
|
|
|
# Spam Protection Module Installation
|
2009-02-04 05:41:14 +01:00
|
|
|
|
2010-06-10 04:31:06 +02:00
|
|
|
## Install
|
2009-02-04 05:41:14 +01:00
|
|
|
|
2010-06-29 07:49:00 +02:00
|
|
|
1. Unzip this file (spamprotection-0.3.tar.gz) inside your SilverStripe installation directory.
|
2010-06-10 04:31:06 +02:00
|
|
|
It should be at the same level as the 'cms' and 'sapphire' modules.
|
2009-02-04 05:41:14 +01:00
|
|
|
|
|
|
|
2. Ensure the directory name for the module is 'spamprotection'.
|
|
|
|
|
2009-07-10 05:32:27 +02:00
|
|
|
3. Visit your SilverStripe site in a webbrowser and run www.yoursite.com/dev/build
|
2009-02-04 05:41:14 +01:00
|
|
|
|
|
|
|
5. We now need to setup some basic features to get the module up and running. Open up _config.php
|
|
|
|
inside project directory (typically 'mysite/_config.php') with your favourite text editor.
|
|
|
|
Read the instructions below to setup the initial configuration of the module.
|
|
|
|
|
|
|
|
|
2010-06-10 04:31:06 +02:00
|
|
|
## Configuring
|
2009-02-04 05:41:14 +01:00
|
|
|
|
2010-06-10 04:31:06 +02:00
|
|
|
Before putting the following code in '_config.php', make sure you have a additional protector class installed.
|
|
|
|
The SpamProtector module only provides the backbone. To make use of the module you have to have an additional protector
|
|
|
|
such as Mollom or Recaptcha. Both of these modules can be downloaded off the SilverStripe.org website.
|
2009-02-04 05:41:14 +01:00
|
|
|
|
2010-06-10 04:31:06 +02:00
|
|
|
SpamProtectorManager::set_spam_protector('MollomSpamProtector');
|
2009-02-04 05:41:14 +01:00
|
|
|
|
|
|
|
|
2010-06-10 04:31:06 +02:00
|
|
|
## Updating a form to include Spam Protection
|
2009-02-04 05:41:14 +01:00
|
|
|
|
|
|
|
This following code should appear after the form creation.
|
|
|
|
|
2010-06-10 04:31:06 +02:00
|
|
|
// your existing form code here...
|
|
|
|
$form = new Form( .. );
|
|
|
|
|
|
|
|
// add this line
|
|
|
|
$protector = SpamProtectorManager::update_form($form, 'Message');
|
2009-02-04 05:41:14 +01:00
|
|
|
|
2009-06-05 00:57:33 +02:00
|
|
|
This code add an instance of a 'SpamProtectorField' class specified in SETTING UP THE MODULE section. The newly created field will have
|
2009-03-25 03:14:26 +01:00
|
|
|
MollomField field. The first parameter is a Form object in which the field will be added into and the second parameter tells
|
2009-06-05 01:44:08 +02:00
|
|
|
SpamProtectorManagor to place the new field before a field named 'Message'.
|
2010-06-10 04:31:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
## Using Spam Protection with User Forms
|