Plugin Support
Gabor
(@nextendweb_gabor)
Hi @gianemi2!
We aren’t running that filter on our code, because one of the parameters for this is the password and we don’t have access to that. Please send us the exact code you are using and then we can make some suggestions related to it! You could paste it into this forum or you could also send it to us in email: [email protected]
add_filter('wp_authenticate_user', 'check_user_status',10,2);
function check_user_status ($user, $password) {
$user_id = $user->data->ID;
//Controllo se l'utente è bloccato per frode
$fraudBlock = get_user_meta($user_id, '_user_status_block', true);
if($fraudBlock == 1){
$user = new WP_Error( 'fraud_block', __( 'Account bloccato per frode.' ) );
return $user;
}
Thanks for your help
Plugin Support
Gabor
(@nextendweb_gabor)
You could use this code for our logins:
add_filter('nsl_facebook_is_login_allowed', 'nsl_block_fraud_login', 10, 3);
add_filter('nsl_google_is_login_allowed', 'nsl_block_fraud_login', 10, 3);
add_filter('nsl_twitter_is_login_allowed', 'nsl_block_fraud_login', 10, 3);
function nsl_block_fraud_login($isLoginAllowed, $provider, $user_id)
{
$fraudBlock = get_user_meta($user_id, '_user_status_block', true);
if ($fraudBlock == 1) {
\NSL\Notices::addError(__('Account bloccato per frode.'));
return false;
}
return $isLoginAllowed;
}
You only need to add it to those providers you use.