
how to block registration from personal emails: gmail, hotmail, etc. ?
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
how to block registration from personal emails: gmail, hotmail, etc. ?
I need to filter out the regestrations to my site and only allow users to enter their business emails and block anyone trying to use a personal account like hotmail. I've looked through the extensions for joomla and none seem to have any ways of filtering registration email. Is there a way to add this to the standard login module in PHP? 

Re: how to block registration from personal emails: gmail, hotmail, etc. ?
This should be fairly easy for J! 1.5
You would need a User plugin with a onBeforeStoreUser method to validate the email address. Check out the example plugin in plugins/user and this tutorial will help as well...
http://forum.joomla.org/index.php?topic=233628
If this is for 1.0.x I'm afraid I don't have any ideas.
You would need a User plugin with a onBeforeStoreUser method to validate the email address. Check out the example plugin in plugins/user and this tutorial will help as well...
http://forum.joomla.org/index.php?topic=233628
If this is for 1.0.x I'm afraid I don't have any ideas.
Re: how to block registration from personal emails: gmail, hotmail, etc. ?
I think i found the part of the code that validates the form:
but i have no idea how to add the form content checking
Code: Select all
if (form.name.value == "") {
alert( "<?php echo addslashes( html_entity_decode(_REGWARN_NAME) );?>" );
} else if (form.username.value == "") {
alert( "<?php echo addslashes( html_entity_decode(_REGWARN_UNAME) );?>" );
} else if (r.exec(form.username.value) || form.username.value.length < 3) {
alert( "<?php printf( addslashes( html_entity_decode(_VALID_AZ09_USER) ), addslashes( html_entity_decode(_PROMPT_UNAME) ), 2 );?>" );
} else if (form.email.value != "gmail") {
alert( "<?php echo addslashes( html_entity_decode(_REGWARN_MAIL) );?>" );
} else if (form.password.value.length < 6) {
alert( "<?php echo addslashes( html_entity_decode(_REGWARN_PASS) );?>" );
} else if (form.password2.value == "") {
alert( "<?php echo addslashes( html_entity_decode(_REGWARN_VPASS1) );?>" );
} else if ((form.password.value != "") && (form.password.value != form.password2.value)){
alert( "<?php echo addslashes( html_entity_decode(_REGWARN_VPASS2) );?>" );
} else if (r.exec(form.password.value)) {
alert( "<?php printf( addslashes( html_entity_decode(_VALID_AZ09) ), addslashes( html_entity_decode(_REGISTER_PASS) ), 6 );?>" );
} else {
form.submit();
but i have no idea how to add the form content checking
Re: how to block registration from personal emails: gmail, hotmail, etc. ?
I don't think this would work...
if (form.email.value != "gmail")
Even if they provided a gmail address it would still return false. You need a regex check for gmail.
if (form.email.value != "gmail")
Even if they provided a gmail address it would still return false. You need a regex check for gmail.
Re: how to block registration from personal emails: gmail, hotmail, etc. ?
i have no clue how to set up a regex
this does not seem to work
Code: Select all
} else if (eregi('^[a-zA-Z0-9._-]+@[gmail]+\.[a-zA-Z.]{2,5}$', $email)){
alert( "<?php echo addslashes( html_entity_decode(_REGWARN_MAIL) );?>" );
this does not seem to work