Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8959719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:30:19+00:00 2026-06-15T15:30:19+00:00

How to customize in a Symfony2.1 app the error messages provided by the UserChecker

  • 0

How to customize in a Symfony2.1 app the error messages provided by the UserChecker class when using an User class that implements AdvancedUserInterface?

These messages are provided for instance when user is not enabled or its account has been locked!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:30:20+00:00Added an answer on June 15, 2026 at 3:30 pm

    You can do it even in Symfony 2.0 easily.

    There is no need to reimplement the UserCheckerInterface.

    Implement the login form as described here: Using a Traditional Login Form.

    $error is actually an instance of AuthenticationException.

    If you display it in the template like this:

    {% if error %}{{ error.message|trans }}{% endif %}
    

    … then you can customize the messages using the translation component, ex. in your messages.en.yml:

    'User account is locked.': 'Your account has been locked by administrator.'
    'The presented password is invalid.': 'Invalid password.'
    'Bad credentials': 'Invalid username.'
    

    If you do that you get translations for free 🙂

    BTW I’ve read a case study that suggested that specyfing to the user what exactly went wrong with the login (pass? username?) outweighs the security issues (in terms of UX) and greatly improves the conversion (returning users).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the guide http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html i'm trying to customize error message, but i've a problem:
How can I customize the error messages for sub options when validating numericality on
Is there a simple way to modify/customize error messages generated by Symfony validators? eg.
I'm trying to customize Symfony2 form rendering to add a class to every select
I want to customize the error handling in symfony2 forms. If a error occured,
I am trying to customize the error message displayed when a user inputs text
Trying to customize Symfony2 form to produce html code looking like the following example:
I'm tring to customize error rendering in my form according to this example .
I need to customize Solr highlighting prefix and suffix like this: <span class=highlight>text</span> instead
I'm attempting to customise the form layouts using Twig in symfony2. I am aiming

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.