How do I get my Joomla sites to accept only no free e-mail address

Discussion in 'Security' started by jb007uk, Jul 18, 2008.

  1. #1
    Hi,

    I have been on a few sites whereby they do not accept yahoo, MSN etc and I have had to use my cable ISP e-mail instead of my Yahoo account. I would like to setup the same as my sites have been receiving loads of Porno spam signups even though I do not activate the assholes account. On another site it has a major virus/spyware on it which must have come about by someone signing up as a member.

    Thanks for any replies.

    Rgds - JB
     
    jb007uk, Jul 18, 2008 IP
  2. Yousif

    Yousif Banned

    Messages:
    233
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes, you can create a black list, or a white list strictly based on accepted email types. Here's a script I came up with that is similar to what you are looking for:

    --------------
    }
    // Email Validation
    function checkEmail(myForm,mess)
    {
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(myForm.value))
    {
    return (true)
    }
    alert(mess);
    myForm.focus();
    return (false)
    }

    // Check against blacklist
    function validateEmail(myForm,mess)
    {
    email = myForm.value.toLowerCase();
    blacklist = new Array("@138mail.com",
    "@test.com","@address.com","@animail.net","@aol.com","@asiamail.com","@aussiemail.com.au",

    "@yahoo.ca","@Yahoo.com","@yahoo.com","@yyhmail.com"
    );
    for (i=0;i<blacklist.length;i++) {
    myRE = new RegExp(blacklist, "i");
    results = email.match(myRE);
    if (results != null) {
    alert(mess);
    myForm.focus();
    return (false);
    }
    }

    ---------
    If you do need additional help, feel free to PM me.
     
    Yousif, Jul 18, 2008 IP
  3. jb007uk

    jb007uk Active Member

    Messages:
    498
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Many thanks Yousif,

    Rgds - JB
     
    jb007uk, Jul 19, 2008 IP