2009-02-03 22:29:55 +01:00
|
|
|
<?php
|
2016-10-10 07:44:28 +02:00
|
|
|
namespace SilverStripe\Spamprotection;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\Deprecation;
|
2009-09-17 06:06:53 +02:00
|
|
|
|
2017-07-07 04:23:01 +02:00
|
|
|
/**
|
2009-08-11 04:51:03 +02:00
|
|
|
* @package spamprotection
|
2014-02-10 08:53:59 +01:00
|
|
|
*
|
|
|
|
* @deprecated 1.0
|
2009-02-03 22:29:55 +01:00
|
|
|
*/
|
2009-08-11 04:51:03 +02:00
|
|
|
|
2015-11-21 07:15:15 +01:00
|
|
|
class SpamProtectorManager
|
|
|
|
{
|
|
|
|
private static $spam_protector = null;
|
2014-02-10 08:53:59 +01:00
|
|
|
|
2015-11-21 07:15:15 +01:00
|
|
|
public static function set_spam_protector($protector)
|
|
|
|
{
|
2017-07-07 04:23:01 +02:00
|
|
|
Deprecation::notice(
|
|
|
|
'1.1',
|
2015-11-21 07:15:15 +01:00
|
|
|
'SpamProtectorManager::set_spam_protector() is deprecated. '.
|
|
|
|
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
|
|
|
|
);
|
2014-02-10 08:53:59 +01:00
|
|
|
|
2016-10-10 07:44:28 +02:00
|
|
|
static::$spam_protector = $protector;
|
2015-11-21 07:15:15 +01:00
|
|
|
}
|
2014-02-10 08:53:59 +01:00
|
|
|
|
2015-11-21 07:15:15 +01:00
|
|
|
public static function get_spam_protector()
|
|
|
|
{
|
2017-07-07 04:23:01 +02:00
|
|
|
Deprecation::notice(
|
|
|
|
'1.1',
|
2015-11-21 07:15:15 +01:00
|
|
|
'SpamProtectorManager::get_spam_protector() is deprecated'.
|
2017-07-07 04:23:01 +02:00
|
|
|
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
|
|
|
|
);
|
2014-02-10 08:53:59 +01:00
|
|
|
|
2016-10-10 07:44:28 +02:00
|
|
|
return static::$spam_protector;
|
2015-11-21 07:15:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function update_form($form, $before = null, $fieldsToSpamServiceMapping = array(), $title = null, $rightTitle = null)
|
|
|
|
{
|
2017-07-07 04:23:01 +02:00
|
|
|
Deprecation::notice(
|
|
|
|
'1.1',
|
2015-11-21 07:15:15 +01:00
|
|
|
'SpamProtectorManager::update_form is deprecated'.
|
|
|
|
'Please use $form->enableSpamProtection() for adding spamprotection'
|
|
|
|
);
|
2014-02-10 08:53:59 +01:00
|
|
|
|
2015-11-21 07:15:15 +01:00
|
|
|
return $form->enableSpamProtection();
|
|
|
|
}
|
|
|
|
}
|