Seite 1 von 1

email bannen, wildcards?

Verfasst: 20.03.2006 10:35
von Onni
Hallo!

Kann man hinter dem "@"-Zeichen keine wildcards verwenden? Wenn ich z. B. *@ya*ma.com eingebe, wird dieser string nicht in die Bannliste aufgenommen. Oder darf man das Sternchen nur einmal benutzen?

Am liebsten würde ich alle .info-email-Adressen bannen, weil bisher nur Ungutes aus dieser Richtung in der Mitgliederliste aufgetaucht ist... Wie könnte ich das machen?

Vielen Dank!

Verfasst: 20.03.2006 11:43
von Fabrizio
Hi Onni,

du kannst die Bannfunktion durch den folgenden MOD erweitern, dann kannst du auch folgendermaßen Bannen: "*@bla.*". Ich weiß leider nicht mehr den genauen Downloadlink. Ich hatte ihn damals auf www.php.com geladen.

Hier mal der MOD:

Code: Alles auswählen

############################################################## 
## MOD Title: Ban Entire Groups of Email Domains with wildcard
## MOD Author: jsmotta < phpbb@rusticweb.com > (Jonathan Motta) http://www.rusticweb.com/
## MOD Description: Allows another * wildcard to be placed in
## the domain of banned emails, so that entire groups of
## similar free email domains can be banned at once.
## So now "*@yahoo*" matches jerky@yahoo.com, jerky@yahoo.nu,
##    jerky@yahoo.de, etc, etc, etc. 
##
## MOD Version: 1.0.0
## 
## Installation Level: Easy 
## Installation Time: ~3 Minutes 
## Files To Edit: admin/admin_user_ban.php 
## Included Files: N/A
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## MOD History:
## 
## Dec 24, 2003 (Merry Christmas!) - Version 1.0.0
##  - Initial Release
############################################################## 
## Author Notes: 
## My very first phpBB MOD... is it really this easy?
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_user_ban.php

# 
#-----[ FIND ]------------------------------------------ 
# 
if (preg_match('#^(([a-z0-9&.-_+])|(\*))+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+$#is', trim($email_list_temp[$i]))) 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
if (preg_match('#^(([a-z0-9&.-_+])|(\*))+@[a-z0-9\-\.]+((\.([a-z0-9\-]+\.)*?[a-z]+)|(\*))$#is', trim($email_list_temp[$i])))

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Gruß,
Fabrizio

Verfasst: 20.03.2006 12:10
von Onni
Hi Fabrizio,

danke schon mal! Kann ich das Sternchen mit dem MOD auch vor dem Punkt einsetzen, also zwischen @ und . - z. B. "*@*.info"?

Grüße, Onni

Verfasst: 20.03.2006 15:59
von cYbercOsmOnauT
Hallo Onni,

nein, das kann die obige Regex nicht.

Anstatt

Code: Alles auswählen

#
#-----[ REPLACE WITH ]------------------------------------------
#
if (preg_match('#^(([a-z0-9&.-_+])|(\*))+@[a-z0-9\-\.]+((\.([a-z0-9\-]+\.)*?[a-z]+)|(\*))$#is', trim($email_list_temp[$i])))
mach

Code: Alles auswählen

#
#-----[ REPLACE WITH ]------------------------------------------
#
if (preg_match('#^(([a-z0-9&.-_+])|(\*))+@[a-z0-9\-\.\*]+((\.([a-z0-9\-]+\.)*?[a-z]+)|(\*))$#is', trim($email_list_temp[$i])))
dann gehts.

Viele Grüße,
Tekin