IP Sperre in 1.4.7 klappt nicht

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
User avatar
Kallabis
Posts: 152
Joined: Sat 3. Apr 2010, 22:37
Location: Germany-Inhouse

IP Sperre in 1.4.7 klappt nicht

Post by Kallabis »

Hallo zusammen,hallo FlipFlop
ich wollte die IP Sperre für das Gästebuch aktivieren. Habe auch wie im phpwcms-HowTo:wiki, unter IP-Sperre beschrieben, den
Codeschnipsel :
// Banned IP ================= +kh 24.10.09
if( !empty($guestbook['ban_ip']) ) {

$_ip = getRemoteIP();

$_ipex = explode('.', $_ip);

//exampl.IP 123.456.678.901
// $_ipex [0] [1] [2] [3]

$_ipex[3] = '*'; // 123.456.678.*
$_ip01 = implode ('.',$_ipex);
$_ipex[2] = '*'; // 123.456.*.*
$_ip02 = implode ('.',$_ipex);


if ( strpos($guestbook['ban_ip'], $_ip01) OR // xxx.yyy.zzz.*
strpos($guestbook['ban_ip'], $_ip02) OR // xxx.yyy.*.*
strpos($guestbook['ban_ip'], $_ip) )
{
$guestbook['flooding'] = 1;
$guestbook['readform'] = 1;
// $guestbook['spamalert'] = '<div class="spamFormAlert">Your IP '.getRemoteIP().' is not allowed to send form (Blacklist)!</div>';
$guestbook['spamalert'] = '<div class="spamFormAlert"><br /><hr><strong>Sorry, your are not allowed to send form!</strong><hr><br /></div>';
}
}
// ===============================

eingefügt. Nun bekomme ich aber den Tag nicht angezeigt um die IP Adressen einzutragen.
Wo liegt mein Fehler??

Gruß
Rkalli
von nix...kütt nix
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: IP Sperre in 1.4.7 klappt nicht

Post by update »

Da steht doch: Tag (in der Vorlage): <!–BAN_IP_START–>...usw
Oder?
Soll wohl heißen: schreib das in die Vorlage....
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: IP Sperre in 1.4.7 klappt nicht

Post by flip-flop »

Ich mache das mittlerweile anders und sperre ganze Regionen in der .htaccess aus, deren User im Normalfall nichts mit den Seiten anfangen können. Seit dem gibt es kein Spam mehr in den Gästebüchern, außer einige deutsche politisch motivierte Einträge, die dann mit einem speziellen Script gefiltert werden.

Hier die .htaccess Filter:

Code: Select all

http://www.wizcrafts.net/htaccess-blocklists.html
Scrollen bis:
Our .htaccess blocklists:

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: IP Sperre in 1.4.7 klappt nicht

Post by update »

That's better, indeed! And that's even mucho moro better:

Code: Select all

http://bot-trap.de
:D
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Post Reply