forked from GNUsocial/gnu-social
Use plugin configuration instead of common_config()
This commit is contained in:
parent
76cc791642
commit
3b5299b5ca
@ -69,13 +69,13 @@ define('MOLLOM_REDIRECT', 1200);
|
|||||||
|
|
||||||
class MollomPlugin extends Plugin
|
class MollomPlugin extends Plugin
|
||||||
{
|
{
|
||||||
function __construct($url=null) {
|
public $public_key;
|
||||||
parent::__construct();
|
public $private_key;
|
||||||
}
|
public $servers;
|
||||||
|
|
||||||
function onStartNoticeSave($notice)
|
function onStartNoticeSave($notice)
|
||||||
{
|
{
|
||||||
if (common_config('mollom', 'public_key')) {
|
if ( $this->public_key ) {
|
||||||
//Check spam
|
//Check spam
|
||||||
$data = array(
|
$data = array(
|
||||||
'post_body' => $notice->content,
|
'post_body' => $notice->content,
|
||||||
@ -123,9 +123,9 @@ class MollomPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct the server URL:
|
// Construct the server URL:
|
||||||
$public_key = common_config('mollom', 'public_key');
|
$public_key = $this->public_key;
|
||||||
// Retrieve the list of Mollom servers from the database:
|
// Retrieve the list of Mollom servers from the database:
|
||||||
$servers = common_config('mollom', 'servers');
|
$servers = $this->servers;
|
||||||
|
|
||||||
if ($servers == NULL) {
|
if ($servers == NULL) {
|
||||||
// Retrieve a list of valid Mollom servers from mollom.com:
|
// Retrieve a list of valid Mollom servers from mollom.com:
|
||||||
@ -205,8 +205,8 @@ class MollomPlugin extends Plugin
|
|||||||
*/
|
*/
|
||||||
private function authentication() {
|
private function authentication() {
|
||||||
|
|
||||||
$public_key = common_config('mollom', 'public_key');
|
$public_key = $this->public_key;
|
||||||
$private_key = common_config('mollom', 'private_key');
|
$private_key = $this->private_key;
|
||||||
|
|
||||||
// Generate a timestamp according to the dateTime format (http://www.w3.org/TR/xmlschema-2/#dateTime):
|
// Generate a timestamp according to the dateTime format (http://www.w3.org/TR/xmlschema-2/#dateTime):
|
||||||
$time = gmdate("Y-m-d\TH:i:s.\\0\\0\\0O", time());
|
$time = gmdate("Y-m-d\TH:i:s.\\0\\0\\0O", time());
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
The mollom plugin uses mollom.com to filter SN notices for spam.
|
||||||
|
|
||||||
== Dependencies ==
|
== Dependencies ==
|
||||||
Your webserver needs to have xmlrpc php extention loaded.
|
Your webserver needs to have xmlrpc php extention loaded.
|
||||||
This is called php5-xmlrpc in Debian/Ubuntu
|
This is called php5-xmlrpc in Debian/Ubuntu
|
||||||
@ -5,11 +7,13 @@ This is called php5-xmlrpc in Debian/Ubuntu
|
|||||||
== Installation ==
|
== Installation ==
|
||||||
Add the following to your config.php
|
Add the following to your config.php
|
||||||
<?php
|
<?php
|
||||||
addPlugin('Mollom');
|
addPlugin('Mollom',
|
||||||
|
array(
|
||||||
$config['mollom']['public_key'] = '...';
|
'public_key' => '...',
|
||||||
$config['mollom']['private_key'] = '...';
|
'private_key' => '...',
|
||||||
$config['mollom']['servers'] = array('http://88.151.243.81', 'http://82.103.131.136');
|
'servers' => array('http://88.151.243.81', 'http://82.103.131.136')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user