It looks like i'm the only one on the internet to need something like that, i'm out of options to search for a solution to this problem, but i'm sure people here will come to a solution :)
With FOSUserBundle, i want the following workflow:
What i don't want is a confirmation email or any way for the user to validate its account by itself.
I'm aware of this question: Admin-reviewed registration in Symfony2 / FosUSerBundle but it's a different problem, because the OP uses confirmation emails.
The problem is that i don't see how to force FOSUserBundle not to enable the user on creation while not activating the confirmation mechanism (token + email)
Anyone? Thank you in advance.
I think you have to override FOSUser controller . The page shows exactly the controller you need to edit :)
You will have to :
You could override the user constructor and set the user field 'locked' to true on all new accounts. Then in your admin section, you can manually edit the user and set it 'locked' to false after you setup the custom property.
public function __construct()
{
$this->salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
$this->enabled = false;
$this->locked = true;
$this->expired = false;
$this->roles = array();
$this->credentialsExpired = false;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.