The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

potential code for stopping spam?

View previous topic View next topic Go down

potential code for stopping spam?

Post by koimaster on November 23rd 2011, 6:46 am

In Sources/Register.php after

Code: [Select]
// Set the options needed for registration.
You could add something like this:

Code: [Select]
//SPAM CHECK
function doBanAdd(){
include_once('Sources/ManageBans.php');
$_REQUEST['bg'] = 10; //Set this to whatever ban you want to use.
$_POST['add_new_trigger']='Add';
$_POST['HBan']="YourCustomKeyHERE";
BanEdit();
}

isBannedEmail($_POST['email'], 'cannot_register', 'Sorry, you are not allowed to register on this forum.');

if(isset($_SERVER['HTTP_X_FORWARD_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARD_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}

$xml_string = file_get_contents('http://www.stopforumspam.com/api?email='.$_POST['email']);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes')
{
$_POST['bantype'] = 'email_ban';
doBanAdd();
}
else
{
$xml_string = file_get_contents('http://www.stopforumspam.com/api?ip='.$ip);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes')
{
$_POST['bantype'] = 'ip_ban';
$_POST['ip']=$ip;
doBanAdd();
}
}
//END SPAM CHECK


Then in Sources/ManageBans.php
Find:

Code: [Select]
if (!empty($_POST['add_new_trigger']) || !empty($_POST['edit_trigger']))
{
checkSession();

And replace with:

Code: [Select]
if (!empty($_POST['add_new_trigger']) || !empty($_POST['edit_trigger']))
{
if(!isset($_POST['HBan']) || $_POST['HBan']!=="YourCustomKeyHERE")checkSession();

Then find:

Code: [Select]
$context['sub_template'] = 'ban_edit';

Replace with:

Code: [Select]
if(!isset($_POST['HBan']) || $_POST['HBan']!=="YourCustomKeyHERE")$context['sub_template'] = 'ban_edit';




remember to replace "YourCustomKeyHERE" with a secret key.

koimaster
Forumember

Male Posts : 162
Reputation : 0
Language : english
Location : Oregon

http://watchlords.forumotion.net/

Back to top Go down

Re: potential code for stopping spam?

Post by Guest on November 23rd 2011, 1:32 pm

Sorry, but PHP or SQL files doesn't work on forumotion. Anyway, you can suggest it here - http://help.forumotion.com/f30-suggestions-for-your-forums Wink

Guest
Guest


Back to top Go down

Re: potential code for stopping spam?

Post by LGforum on November 23rd 2011, 1:40 pm

Forumotion will never (99.9% sure) allow PHP scripts.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: potential code for stopping spam?

Post by ShinyTwinky69 on November 23rd 2011, 3:03 pm

LGforum just to add something, they is many resaons why it won't be allowed, and that includes abuse.

ShinyTwinky69
Forumember

Male Posts : 35
Reputation : 1
Language : English/Spanish
Location : El Paso, Texas, United States

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum