Re: E-mail domains blacklist doesn't work
Ok. Here’s the code. Find this in bp-core-signup.php
if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
$emaildomain = substr( $user_email, 1 + strpos( $user_email, ‘@’ ) );
if ( in_array( $emaildomain, (array)$limited_email_domains ) == false )
$errors->add( ‘user_email’, __( ‘Sorry, that email address is not allowed!’, ‘buddypress’ ) );
}
BELOW IT, ADD THIS;
//MY HACK
$banned_email_domains = get_site_option( ‘banned_email_domains’, ‘buddypress’ );
if ( is_array( $banned_email_domains ) && empty( $banned_email_domains ) == false ) {
$emaildomain = substr( $user_email, 1 + strpos( $user_email, ‘@’ ) );
if ( in_array( $emaildomain, (array)$banned_email_domains ) == true )
$errors->add( ‘user_email’, __( ‘Sorry, that email address is not allowed!’, ‘buddypress’ ) );
}
//MY HACK