You are here

protected function SocialUserLoginForm::setGeneralErrorMessage in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  2. 8 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  3. 8.2 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  4. 8.3 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  5. 8.4 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  6. 8.5 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  7. 8.6 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  8. 8.8 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  9. 10.3.x modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  10. 10.0.x modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  11. 10.1.x modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  12. 10.2.x modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
2 calls to SocialUserLoginForm::setGeneralErrorMessage()
SocialUserLoginForm::validateFinal in modules/social_features/social_user/src/Form/SocialUserLoginForm.php
Checks if user was not authenticated, or if too many logins were attempted.
SocialUserLoginForm::validateNameMail in modules/social_features/social_user/src/Form/SocialUserLoginForm.php
Sets an error if supplied username or mail has been blocked.

File

modules/social_features/social_user/src/Form/SocialUserLoginForm.php, line 252

Class

SocialUserLoginForm
Class SocialUserLoginForm.

Namespace

Drupal\social_user\Form

Code

protected function setGeneralErrorMessage(array &$form, FormStateInterface $form_state) {
  $form_state
    ->setErrorByName('name_or_mail', $this
    ->t('
        Oops, there was an error. This may have happened for the following reasons: <br>
        - Invalid username/email and password combination. <br>
        - There has been more than one failed login attempt for this account. It is temporarily blocked. <br>
        - Too many failed login attempts from your computer (IP address). This IP address is temporarily blocked. <br> <br>
        To solve the issue, try using different login information, try again later, or <a href=":url">request a new password</a>', [
    '%name_or_email' => $form_state
      ->getValue('name_or_mail'),
    ':url' => $this
      ->url('user.pass'),
  ]));
}