A specific email domain for registration ?

14 years 5 months ago #10220 by justberare
A specific email domain for registration ? was created by justberare
Hi,

I was wondering if it was possible to hack the registration script to limit the registration to people using @domain1.net or @domain2.net or @domain3.net emails .

And something like a dialog box if the email domain is not correct.

Someone did it for me on an old site but I don't remember what this little piece of code is.

thx

Please Log in to join the conversation.

14 years 5 months ago #10229 by justberare
Replied by justberare on topic Re:A specific email domain for registration ?
it should be something like this :


[code:1]function controlerEmail(valeur) {
ctl = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/;
if (valeur.search(ctl) != -1) return true;
else return false;
}

à utiliser ainsi :

if(controlerEmail(formulaire.email.value) == false))
alert("Votre adresse e-mail est naze !"«»);[/code:1]

But the thing is that I have 3 specific domains :(

if someone has a solution ...

Please Log in to join the conversation.

14 years 3 months ago #14520 by woonydanny
Replied by woonydanny on topic Re:A specific email domain for registration ?
i am trying to do the same thing. only have people with a certain email address able to sign up. (university club, so everyone has to have a university email to sign up).

I have found a solution for it on the joomla.org forums but it is only for the com_registration component not for community builder. Does anyone know how to do this?

The code above looks to be in french? is the english version of this do what i am after, and if so, could you please post it.

this was the part in com_registration to add below line 79 on the registration.html.php file:

} else if (form.email.value.indexOf("@emaildomainiwant.com") < 0) {
alert( "<?php echo 'Sorry, this email address is not allowed to register on this site.';?>" );

Please Log in to join the conversation.

14 years 3 months ago #14621 by woonydanny
Replied by woonydanny on topic Re:A specific email domain for registration ?
hoping someone could enlighten me on this as soon as possible, as its a hurdle i need to jump in the near future. ;)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.380 seconds

Facebook Twitter LinkedIn