I’m using Symfony 2 security system.
When some user trying to login, I want to additionally check whether user’s field “activated” is true. If not, error message appears: “You have to activate your account first”.
How can i implement this feature?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If you’re using Doctrine as user provider you can implement the
AdvancedUserInterface. This interface (definition visible below) provide theisEnabled()method which is equal to account activation status method. If this method return false, the user will have an error message like Your account is not enabled when he attempt to login.I use it to provide e-mail validation on subscription.