miniBB ®
 
miniBB Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Premoderation addon for miniBB Worried about forum enemies? Pre-approve postings and members with the Premoderation add-on!
Custom Tutorials and Modifications miniBB Community Forum / Custom Tutorials and Modifications /
Short link for this topic:

Blocking registration emails filtered by domain

Author Anonymous
Guest
#1 | Posted: 17 Jan 2007 04:44
Is it possible to block users registration based on e-mail.

I want to block mails with the extension @mail.ru
Author Paul
CEO
#2 | Posted: 17 Jan 2007 06:38
I think you may look up in bb_func_checkusr.php file and edit the line which lists:

elseif(!eregi("^[0-9a-z]+([._-][0-9a-z_]+)*_?@[0-9a-z]+([._-][0-9a-z]+ )*[.][0-9a-z]{2}[0-9A-Z]?[0-9A-Z]?$", ${$dbUserSheme['user_email'][1]})) $correct=4;

so it would list something like...

elseif(!eregi("^[0-9a-z]+([._-][0-9a-z_]+)*_?@[0-9a-z]+([._-][0-9a-z]+ )*[.][0-9a-z]{2}[0-9A-Z]?[0-9A-Z]?$", ${$dbUserSheme['user_email'][1]}) OR substr_count(strtolower(${$dbUserSheme['user_email'][1]}), 'mail.ru')>0 ) $correct=4;

Have not tested it but it should work...
Author Anonymous
Guest
#3 | Posted: 17 Jan 2007 07:39
Thanks, it works fine.
Author Anonymous
Guest
#4 | Posted: 22 Jan 2007 09:46
Sorry, but I have to try again. This time I need help to block everybody on there e-mail, unless they come form my own country. I tried by my self, but it didn't work out.
Author Paul
CEO
#5 | Posted: 22 Jan 2007 12:33 | Edited by: Paul
What is meant by "my own counry"? What domain zone is it like?..
Author Anonymous
Guest
#6 | Posted: 23 Jan 2007 09:26
Visitors can only be register when they have an e-mail address ending on .dk

Like hans@jubii.dk
Author Paul
CEO
#7 | Posted: 23 Jan 2007 09:31 | Edited by: Paul
OR substr_count(strtolower(${$dbUserSheme['user_email'][1]}), '.dk')==0

is it really so difficult to imagine?.. ;-)
Author Anonymous
Guest
#8 | Posted: 1 Jul 2007 18:42
What if you have more than one domain you want to list? How would you write that?
Author Paul
CEO
#9 | Posted: 2 Jul 2007 08:05 | Edited by: Paul
You need to specify array list of all forbidden domains... for example, in bb_specials.php like

$forbidden_domains=array(
'.dk',
'.mail.ru',
'.gmail.com'
);

then the condition will be

then in bb_func_checkusr.php right before the starting if (!preg_match paste:

$disallowedDomain=FALSE;
foreach($forbidden_domains as $f) {
if (substr_count(strtolower(${$dbUserSheme['user_email'][1]}), $f)>0) {
$disallowedDomain=TRUE;
break;
}
}

then instead of the condition supplied above it should be

OR $disallowedDomain

i.e.

elseif(!eregi("^[0-9a-z]+([._-][0-9a-z_]+)*_?@[0-9a-z]+([._-][0-9a-z]+ )*[.][0-9a-z]{2}[0-9A-Z]?[0-9A-Z]?$", ${$dbUserSheme['user_email'][1]}) OR $disallowedDomain ) $correct=4;
Author iBall
Forums Member
#10 | Posted: 25 Mar 2008 13:11
hi,

anyone know how to modify software's core file, so that only certain emails are allowed for the registration. eg: xxx@ggmm.edu.com, xxx@ppkk.com

thanks in advance
Author Paul
CEO
#11 | Posted: 25 Mar 2008 14:19 | Edited by: Paul
Try to apply the solution above, but only change the final condition. From

OR $disallowedDomain

to
OR !$disallowedDomain

And so in $forbidden_domains you need to specify the list of the allowed domains.
Custom Tutorials and Modifications miniBB Community Forum / Custom Tutorials and Modifications / Blocking registration emails filtered by domain Top
Your Reply Click this icon to move up to the quoted message

» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
miniBB Community Forum Powered by Free Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts