FOSUserBundle: how to allow registration, confirmation but not activation?

Viewed 930

I'd like the user to register, confirm it's email, but being activated manually by an administrator.

Thanks to this page I found the FOSUserEvents::REGISTRATION_CONFIRMED which is called right after clicking on the confirmation link in the email.

Now I'd like to disable the account (see below).

class RegistrationListener implements EventSubscriberInterface
{
    public static function getSubscribedEvents()
    {
        return array(            
            FOSUserEvents::REGISTRATION_CONFIRMED => 'onRegistrationCompleted'
        );
    }

    public function onRegistrationCompleted(UserEvent $event) {
        // registration completed
        // TODO: disable the user. How?
    }
}

Or is there any configuration that I missed?

Any ideas?

Thanks in advance!

1 Answers
Related