IP Sperre in 1.4.7 klappt nicht
Posted: Wed 21. Dec 2011, 19:36
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
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