public function validateNameMail(array &$form, FormStateInterface $form_state) {
    $user_blocked = social_user_is_blocked($form_state->getValue('name_or_mail'));
    if ($user_blocked) {
      // Blocked in user administration.
      if (!$form_state->get('uid')) {
        $this->setGeneralErrorMessage($form, $form_state);
      }
      else {
        $form_state->setErrorByName('name_or_mail', $this->t('The username %name has not been activated or is blocked.', ['%name' => $form_state->getValue('name_or_mail')]));
      }
    }
  }
public function validateNameMail(array &$form, FormStateInterface $form_state) {
    $user_blocked = social_user_is_blocked($form_state->getValue('name_or_mail'));
    if ($user_blocked) {
      // Blocked in user administration.
      if (!$form_state->get('uid')) {
        $this->setGeneralErrorMessage($form, $form_state);
      }
      else {
        $form_state->setErrorByName('name_or_mail', $this->t('The username %name has not been activated or is blocked.', ['%name' => $form_state->getValue('name_or_mail')]));
      }
    }
  }
public function validateNameMail ( array & $ form , FormStateInterface $ form_state ) { $ user_blocked = social_user_is_blocked ( $ form_state -> getValue ( 'name_or_mail' ) ) ; if ( $ user_blocked ) { // Blocked in user administration. if ( ! $ form_state -> get ( 'uid' ) ) { $ this -> setGeneralErrorMessage ( $ form , $ form_state ) ; } else { $ form_state -> setErrorByName ( 'name_or_mail' , $ this -> t ( 'The username %name has not been activated or is blocked.' , [ '%name' => $ form_state -> getValue ( 'name_or_mail' ) ] ) ) ; } } }
Sets an error if supplied username or mail has been blocked.
Sets an error if supplied username or mail has been blocked .