The MU forums have moved to WordPress.org

Banning email addresses (7 posts)

  1. ColinFilmJournal
    Member
    Posted 17 years ago #

    Hi all,

    I've noticed that there's a 'Limited Email Registrations' option in the admin area. How does this work? Does it block all registrations other than those that are in the list?

    I need to start blocking certain domains/tld's (specifically anything with .biz in the email address due to every single spam attempt coming from that tld) - is that possible with MU as it stands?

    Colin

  2. drmike
    Member
    Posted 17 years ago #

    Yup, if you use it, it will block all domains from registering but those in the list.

    I need a system to block off domains or IP blocks as well.

    Submitting to trac.

  3. ColinFilmJournal
    Member
    Posted 17 years ago #

    I've hacked about a little and have now changed the 'Limited Email Addresses' option so that it blocks the domains specified as I will find that a much more useful option.

    If anyone is interested, replace:

    =======
    $emaildomain = substr( , 1 + strpos( $user_email, '@' ) );
    if( in_array( $emaildomain, $limited_email_domains ) == false ) {
    $errors->add('user_email', __("Sorry, that email address is not allowed!"));
    }

    =======

    With

    =======
    foreach($limited_email_domains as $e => $v) {
    if (strpos($user_email, $v)) {
    $errors->add('user_email', __("Sorry, that email address is banned."));

    }
    }

    =======

    In: wp_includes/wpmu_functions.php

    Ideally it would be good to have another option, but as I won't be using the limited email address functionality I'm happy just to do this quick fix for now.

  4. ColinFilmJournal
    Member
    Posted 17 years ago #

    Just to note, my code above looks for the 'banned' string across the whole email address - so you could ban every hotmail address just by adding hotmail and it would pick up both com and co.uk. Likewise you can ban a tld by just entering that e.g. .biz or .info

  5. drmike
    Member
    Posted 17 years ago #

    Um, could have sworn we had that option since 719.

  6. ColinFilmJournal
    Member
    Posted 17 years ago #

    So we have. I hadn't realised as I only tend to upgrade with the RC relases!

    At least I won't lose functionality when the next RC is out. I was watching the ticket on trac rather than the changelog so didn't realise it was already covered.

  7. drmike
    Member
    Posted 17 years ago #

    Do note though that there was a bug with it that was fixed in 121.

About this Topic

  • Started 17 years ago by ColinFilmJournal
  • Latest reply from drmike