You are here

protected function SocialUserLoginForm::setGeneralErrorMessage in Open Social 10.0.x

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.7 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  9. 8.8 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::setGeneralErrorMessage()
  10. 10.3.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 257

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('
        <p>Oops, there was an error. This may have happened for the following reasons:</p>
        <ul>
          <li>Invalid username/email and password combination. </li>
          <li>There has been more than one failed login attempt for this account. It is temporarily blocked. </li>
          <li>Too many failed login attempts from your computer (IP address). This IP address is temporarily blocked. </li>
        </ul>
        <p>To solve the issue, try using different login information, try again later, or <a href=":url">request a new password</a></p>', [
    '%name_or_email' => $form_state
      ->getValue('name_or_mail'),
    ':url' => Url::fromRoute('user.pass'),
  ]));
}