logout another user

I use symfony 2 with FOSuserbundle. Creat action for lock user with code:

$repository = $this->getDoctrine()->getRepository('MainUserBundle:User')
$user = $repository->findOneByUsername($request->request->get('name'));

/* some code */

$user->setLocked(true);
$em = $this->getDoctrine()->getEntityManager();
$em->persist($user);
$em->flush();

But user get lock-in error message only if he logout and login again. How i can logout another user?

Answers


See my answer to a related question. Basically, you need to check for the lock flag in the equals method. This way, whenever the flag is changed, the user will have to reauthenticate.


Need Your Help

How to get Next Month in Mon yyyy Format?

sql sql-server sql-server-2008 datetime

I have one table that get dates as SaleDate formatted like this

Why and when to use shell instead of Ruby

ruby scripting unix

Since I am conversant in Ruby, I am about to script a few things on OSX using it. But then I thought, perhaps I am missing the boat. I know a lot of reasons to prefer Ruby over Bash (or whatever sh-