One method we use to validate a users email account is to actually send him
an email with a link which he can use to set his password. Therefore once
the password is set, his account is validated.

On Thu, Apr 21, 2011 at 7:30 PM, symfonyMan <ezziani.cha...@gmail.com>wrote:

> Hello,
>
> I have a question about Security in Symfony2.
>
> In my user entity i have a column enabled, when the user registred for the
> first time I set *enabled *to *false* like the FOSUserBundle.
>
> before validate the registration ( confirmation by email => set enabled to
> true ), i can authenticate the user and he can access to his account...
>
> how to check if the user is enabled or not?? ( i don't want to verify that
> in every action..)
>
> is that implemented by symfony ??
>
> in the UserChcker class i see :
>
>  public function checkPostAuth(UserInterface $user)
>     {
>         if (!$user instanceof AdvancedUserInterface) {
>             return;
>         }
>
>         if (!$user->isAccountNonLocked()) {
>             throw new LockedException('User account is locked.', $user);
>         }
>
>         if (!$user->isEnabled()) {
>             throw new DisabledException('User account is disabled.',
> $user);
>         }
>
>         if (!$user->isAccountNonExpired()) {
>             throw new AccountExpiredException('User account has expired.',
> $user);
>         }
>     }
>
> Thanks
>
>  --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
identi.ca: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to