Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Submitters Blocking IPs

Quote Reply
Submitters Blocking IPs
I recently added a field to the database for the submitters IP address so I can add the spammers to the ban list. It appears that some submitters are blocking their IP addy as there's nothing in the field on some of the subs. Is there a way to block those by using wild cards in the ban list? Or maybe just a blank line would do it. Alternatively, will changing the field to "not null = yes" have any effect?

Thanks
Quote Reply
Re: [Spacemanspiff] Submitters Blocking IPs In reply to
Hi,

You could try something like this (in add.cgi). Its "dirty" (i.e not actually a plugin, so would need re-doing when you do upgrades) .. but will stop them:


Code:
if (!$ENV{'REMOTE_ADDR'}) {
print $IN->header();
use Links::SiteHTML;
print Links::SiteHTML::display('error', { error => qq|Sorry, you don't seem to be showing your IP. This blockage is in place to ensure our system isn't inundated by people spamming our directory.|, } );
exit;
}

if ($PLG->dispatch('check_request', \&Links::check_request)) {
$PLG->dispatch('handle_add', \&Links::User::Add::handle);
}

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Submitters Blocking IPs In reply to
Hi Andy,

Where would I put that in add.cgi. I tried a few different places that seemed to make sense but I got 500 Internal Server Errors.

Thanks
Quote Reply
Re: [Spacemanspiff] Submitters Blocking IPs In reply to
Hi,

Mmm.. can you add this just under;

Code:
use strict;

Code:
use CGI::Carp qw(fatalsToBrowser);

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Submitters Blocking IPs In reply to
Here's what I have in add.cgi. The new stuff is in red:

Code:
use strict;

use CGI::Carp qw(fatalsToBrowser);

use lib '/usr/www/virtual/cybmktz/www.1-free-sex-and-porn-pics.com/cgi-bin/admin';
use Links qw/$CFG/;
use Links::User::Add;

if (!$ENV{'REMOTE_ADDR'}) {
print $IN->header();
use Links::SiteHTML;
print
Links::SiteHTML::display('error', { error => qq|Sorry, you don't
seem to be showing your IP. This blockage is in place to ensure our
system isn't inundated by people spamming our directory.|, } );
exit;
}

if ($PLG->dispatch('check_request', \&Links::check_request)) {
$PLG->dispatch('handle_add', \&Links::User::Add::handle);
}



local $SIG{__DIE__} = \&Links::fatal;

Links::init('/usr/www/virtual/cybmktz/www.domain.com/cgi-bin/admin');
Links::init_user();



if (GT::Plugins->dispatch
($CFG->{admin_root_path} . '/Plugins', 'check_request',
\&Links::check_request)) {
GT::Plugins->dispatch
($CFG->{admin_root_path} . '/Plugins', 'handle_add',
\&Links::User::Add::handle);
}

Here's the error message I'm getting:

Code:
Software error: Global symbol "$IN" requires explicit package name at /www/virtual/cybmktz/www.domain.com/cgi-bin/add.cgi line 24.
BEGIN not safe after errors--compilation aborted at /www/virtual/cybmktz/www.domain.com/cgi-bin/add.cgi line 25.
Quote Reply
Re: [Spacemanspiff] Submitters Blocking IPs In reply to
Hi,

Change this line:
Code:
use Links qw/$CFG/;
to:
Code:
use Links qw/$IN $CFG/;


Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Submitters Blocking IPs In reply to
I made that change, now I'm getting this:

Code:
Software error: Global symbol "$PLG" requires explicit package name at /www/virtual/cybmktz/www.domain.com/cgi-bin/add.cgi line 30.
Global symbol "$PLG" requires explicit package name at /www/virtual/cybmktz/www.domain.com/cgi-bin/add.cgi line 31.
Execution of /www/virtual/cybmktz/www.domain.com/cgi-bin/add.cgi aborted due to compilation errors.
Quote Reply
Re: [Spacemanspiff] Submitters Blocking IPs In reply to
You have no need of this:

Code:
if ($PLG->dispatch('check_request', \&Links::check_request)) {
$PLG->dispatch('handle_add', \&Links::User::Add::handle);
}

There is no reason to duplicate base hooks from add.cgi!

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Submitters Blocking IPs In reply to
In Reply To:
You have no need of this:

Code:
if ($PLG->dispatch('check_request', \&Links::check_request)) {
$PLG->dispatch('handle_add', \&Links::User::Add::handle);
}

There is no reason to duplicate base hooks from add.cgi!
Mmm.. what are you on about? This is add.cgi, so that part *needs* be in there Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Submitters Blocking IPs In reply to
But not twice Tongue

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Submitters Blocking IPs In reply to
In Reply To:
But not twice Tongue
He doesn't have it twice ;) Its just the format it was being shown in =)


Code:
if (GT::Plugins->dispatch($CFG->{admin_root_path} . '/Plugins', 'check_request',\&Links::check_request)) {
GT::Plugins->dispatch($CFG->{admin_root_path} . '/Plugins', 'handle_add', &Links::User::Add::handle);
}

(one is inside an "if" statement, the other is inside the "if" statements brackets :P
Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Submitters Blocking IPs In reply to
Nope, he have it twice in the file and this will render add page twice too Wink! See the actual post.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [Spacemanspiff] Submitters Blocking IPs In reply to
Change the use Links qw/$IN $CFG/; to use Links qw/$IN $CFG $PLG/;
And move your code below Links::init_user();

p.s. What version of Links you are using?

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Submitters Blocking IPs In reply to
The form is working now. I'm not sure if it's blocking submissions with no IP address. I don't know how to block mine to test it, but I'll know in a day or so as I go through the submissions.

Here's what I ended up with:

Code:
use strict;

use CGI::Carp qw(fatalsToBrowser);

use lib '/usr/www/virtual/cybmktz/www.domain.com/cgi-bin/admin';
use Links qw/$IN $CFG $PLG/;
use Links::User::Add;

local $SIG{__DIE__} = \&Links::fatal;

Links::init('/usr/www/virtual/cybmktz/www.domain.com/cgi-bin/admin');
Links::init_user();


if (!$ENV{'REMOTE_ADDR'}) {
print $IN->header();
use Links::SiteHTML;
print Links::SiteHTML::display('error', { error => qq|Sorry, you don't seem to be showing your IP. This blockage is in place to ensure our system isn't inundated by people spamming our directory.|, } );
exit;
}


if (GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'check_request', \&Links::check_request)) {
GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'handle_add', \&Links::User::Add::handle);
}

I'm using version 3.2.0

Thanks for all the help.
Quote Reply
Re: [Spacemanspiff] Submitters Blocking IPs In reply to
Glad to hear Wink

btw: You are safe to remove $PLG from use Links qw/$IN $CFG $PLG/; line, you don't need it anymore.

As for IP may be you can try searching for some kind anonymizer service or some kind of software that can do it.


Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Submitters Blocking IPs In reply to
Well, this isn't working. I'm still getting submissions with nothing in the IP address field.

Is there a way to put some text or something in the IP field if it's blank when submitted, like "SPAM" or something. That way I can just search on that field and delete all of them before I start reviewing. I tried searching on blank IP field by changing it to "Exact Match" but that just returned everything.

Thanks
SS
Quote Reply
Re: [Spacemanspiff] Submitters Blocking IPs In reply to
Hi,
This looks weird.

Could you add <%Links::environment%> in bottom of link_added.eml in admin templates and paste return environment from email when you receive such a spam submission?




Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins