Answer the question
In order to leave comments, you need to log in
Authorization in Symfony2 - User account is disabled. How to fix?
Welcome all. I need help - I can't deal with the following situation:
1. Moved the project from the local machine from env=dev ( app_dev.php ) to VDS hosting ( nginx+php5-fpm+mariadb+phpmyadmin+Symfony2 ) from env=prod ( app. php).
2. Connection with a DB functions - this moment tested.
3. Authorization: the standard functionality of Symfony is used (I did not use third-party libraries), bcrypt 12 encryption, the provider - users from the database.
4. Problem: when authorizing, it gives out "User account is disabled" - in fact, I studied solutions on the Internet - nothing helps, in the DB.User the value is_active = 1 initially, there were no such problems on the local version of the project.
5. Question: tell me where else to look, perhaps the described problem arose due to the change of environment from dev to prod. Thank you in advance.
Answer the question
In order to leave comments, you need to log in
Your user class must implement Symfony\Component\Security\Core\User\AdvancedUserInterface in order to work with the standard security component.
According to this interface, there must be an isEnabled() method that returns true. Otherwise, this error occurs.
Thanks a lot for the tip!!! I looked at the User entity - everything is written in it as in the documentation - the User class is implemented from AdvancedUserInterface, there is an isEnabled() method - in theory everything should work.
I looked in the database at the User table, because confused in the User class description:
/**
* @ORM\Column(name="is_active", type="integer")
*/
private $isActive;
/**
* @ORM\Column(name="is_active", type="boolean")
*/
private $isActive;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question