Is there any way to prevent people from registering using a free email provider (ie. Hotmail, Yahoo, etc.)?
Yes. You need to edit your register.php
find:
if (!eregi("^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$", $email)) $error .= '<li>' . $lang_register_php['err_invalid_email'];
and add after it:
$banned = array(
'hotmail',
'yahoo',
'msn',
'gmail'
);
foreach($banned as $ban){
if (strpos(strtolower($email), "@$ban.")){
$error .= '<li>' . 'Registration not permitted from free email providers.';
break;
}
}
You can change the array of banned providers and the rejection message as required. You could also change the message to use $lang_register_php['err_invalid_email'] to give a general message of 'invalid email' in the user's language if you prefer.
This will not work for bridged installs.
what about the opposite? Is there any way I could only allow certain users (i.e. with email addresses from my school) to register?
http://forum.coppermine-gallery.net/index.php?topic=16615.0
LOL *Blushes and never asks question again*
Hi folks.
I have CPG 1.4.10 & BBH 2.0.21 bridged working fine.
Im looking for something that keep out certain domains (like 10minutemail.com or mailinator.com) from registering.
Reading this post and another one (Makc666's) I can't see solution for me but I think should be nice have an editable "blacklist", or something like that, in next releases of CPG (or some plugin).
Im just writing ideas, no solutions, i know. :-\
Going back... anyone knows how can I ban domains having bridged system? ??? Thanks.
You need to do that in your forum.
Thank you very much Nibbler!
What about blocking certain tlds, like .info or .biz?
Could this be made more general by doing for example:
$banned = array(
'@hotmail.',
'@yahoo.',
'@msn.',
'@gmail.',
'.info$',
'.biz$'
);
foreach($banned as $ban){
if (strpos(strtolower($email), "$ban")){
$error .= '<li>' . 'Registration not permitted from free email providers.';
break;
}
}
Try
if (preg_match('/\.(info|biz)$/', $email)){
if (strpos(strtolower($email), "$ban")){
$error .= '<li>' . 'Registration not permitted from this tld.';
break;
}
}
oops.
Of course. My brain was still thinking about the eregi from the previous line, not strpos.
Thanks.
Quote from: Nibbler on February 13, 2007, 06:57:07 PM
Try
if (preg_match('/\.(info|biz)$/', $email)){
if (strpos(strtolower($email), "$ban")){
$error .= '<li>' . 'Registration not permitted from this tld.';
break;
}
}
Should this actually be more like
if (preg_match('/\.(info|biz)$/', $email)) $error .= '<li>' . 'Registration not permitted from this tld.';
since it's no longer in that foreach loop?
Yeah. I copied too much code.
Any chance I can use this code in CPG 1.5.16?
If so, where do I put it?
Quote from: Nibbler on April 11, 2005, 12:55:24 AM
$banned = array(
'hotmail',
'yahoo',
'msn',
'gmail'
);
foreach($banned as $ban){
if (strpos(strtolower($email), "@$ban.")){
$error .= '<li>' . 'Registration not permitted from free email providers.';
break;
}
}