bp_core_validate_email_address
uses the WP function email_exists
.
So perhaps that WP function should check the signups table.
You can open a ticket here and a decision will be made as to whether it should actually be a WP ticket:
https://buddypress.trac.wordpress.org/newticket
Use the same suer / pw you use for these forums.
Thanks ticket has been opened.
For anyone interested, here’s the filter I added to my functions file…
add_filter('bp_core_validate_user_signup', 'check_signups_for_dup');
function check_signups_for_dup($arrResult)
{
//If errors already exist just send it back
if (!empty($arrResult['errors']->errors['user_name']) || !empty($arrResult['errors']->errors['user_email'])) {
return $arrResult;
}
global $wpdb;
$strUsernameQry = "SELECT COUNT(*) FROM {$wpdb->prefix}signups WHERE active='0' AND user_login = %s";
$strEmailQry = "SELECT COUNT(*) FROM {$wpdb->prefix}signups WHERE active='0' AND user_email = %s";
$intUsernames = $wpdb->get_var($wpdb->prepare($strUsernameQry, $arrResult['user_name']));
$intEmails = $wpdb->get_var($wpdb->prepare($strEmailQry, $arrResult['user_email']));
if (!empty($intUsernames)) {
$arrResult['errors']->add('user_name', 'Sorry, a signup with that username already exists');
}
if (!empty($intEmails)) {
$arrResult['errors']->add('user_email', 'Sorry, a signup with that email already exists');
}
return $arrResult;
}
Thanks for opening the ticket.
https://buddypress.trac.wordpress.org/ticket/6895
In the ticket, please add a reference to this thread and also paste your useful filter.