Questions tagged [fosuserbundle]

The FOSUserBundle adds support for a database-backed user system in Symfony2. It provides a flexible framework for user management that aims to handle common tasks such as user registration and password retrieval.

The FOSUserBundle adds support for a database-backed user system in Symfony2. It provides a flexible framework for user management that aims to handle common tasks such as user registration and password retrieval.

Features include:

  • Users can be stored via Doctrine ORM, MongoDB/CouchDB ODM or Propel
  • Registration support, with an optional confirmation email
  • Password reset support
  • Unit tested
2611 questions
10
votes
2 answers

Managing users/roles/groups in FOSUserBundle

I am developing a simple CRUD to manage users/roles/groups of the application in which I am working. To manage users I'm using FOSUserBundle. What I want to do can be accomplished in several ways: Assigning roles to groups and then assign users to…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
10
votes
1 answer

Adding customised validation rules to SonataUserBundle

I have installed SonataUserBundle according to the docs and it all works fine. Except that I cannot add custom validation rules. My understanding is that the new rules should be added to a new Validation Group and then config.yml is updated to tell…
caponica
  • 3,788
  • 4
  • 32
  • 48
10
votes
4 answers

Getting the user id from logged in user in FOSUserBundle

I am trying to create a task manager and I need to be able to get the user id of the user that is currently logged in so that when the task is created the user id is entered into the database as well. I can not get it to work it keeps telling me…
Zach Starnes
  • 3,108
  • 9
  • 39
  • 63
10
votes
5 answers

Invalid CSRF token on my own login form

I'm working on a symfony application using FOSUserBundle. I want to have a dropdown login form in the menubar if i am not authenticated, which have a complete different style that the one under /login. I'm getting 'Invalid CSRF token'. I'm a…
roirodriguez
  • 1,685
  • 2
  • 17
  • 31
10
votes
4 answers

FOSUserBundle: How to best integrate login and register form in one template?

I am using the FOSUserBundle in my Symfony application which is really great. They have the login and register forms in a separate template. I want both in one template to display them next to each other. Therefore I created…
tester
  • 3,977
  • 5
  • 39
  • 59
10
votes
4 answers

Locale switch in login of FOSUserBundle

I'm trying to get locale switching to work in the login screen of my application. In order to do that I have links on my login page that point to site.com/ (the default locale) and site.com/en (the second locale I support). As soon as I've logged…
Jens Wegar
  • 4,147
  • 4
  • 29
  • 34
10
votes
2 answers

Symfony2 - Doctrine and FOSUserBundle - wrong annotations

I am new to Symfony2 in general. This issue relates to Doctrine and FOSUserBundle though. I have the following User.php Entity created based on FOSUserBundle and a self-referencing many-to many.
Piddien
  • 1,436
  • 4
  • 18
  • 38
10
votes
2 answers

Adding Captcha to Symfony2 Login Page

I am new to Symfony2 but read about it very much. First of all, I am using symfony 2.1.7. And FOSUserBundle for user settings. I have already override fos_user-login template, with username and password. But I want to add a captcha for log in. I…
tigris
  • 404
  • 1
  • 5
  • 17
10
votes
5 answers

Creating an admin user using datafixtures and fosuserbundle

I'm trying to create a new User Admin from a fixture. I'm using FOSUserBundle and Symfony2. $userManager = $this->container->get('fos_user.user_manager'); //$userAdmin = $userManager->createUser(); $userAdmin = new…
Gabriel Muñumel
  • 1,876
  • 6
  • 34
  • 57
9
votes
3 answers

Change the role of a distant user without having to relog

I am trying to change the role of a user, using the FOSUserBundle. The problem is: if the user is logged at the same time, he has to relog to see the new role. Any solutions ?
Joffrey
  • 91
  • 1
  • 4
9
votes
5 answers

Symfony2 login FOS UserBundle in functional tests

How to login inside tests to be able to do user-specific actions?
VitalyP
  • 1,867
  • 6
  • 22
  • 31
9
votes
4 answers

Create a symfony2 remember me cookie manually (FOSUserBundle)

Could somebody explain how you can manually create a remember me cookie in a controller? I want the users to stay logged in after they pressed the "register" button, without having to login with their credentials afterwards. I've tried to create a…
Jonas Wouters
  • 707
  • 1
  • 7
  • 22
9
votes
1 answer

FOSUserBundle managing In EasyAdminBundle(( The "User" entity must define its associated Doctrine entity class using the "class" option))Symfony

I am using Symfony 3.4 with FOSUserBundle~2.0 and EasyAdminBundle^1.17.everything works fine.i can login to system and create user ((ofcourse with commend line)) i using this toutaril but when i want to managing in EasyAdminBundle.i have this error …
pedram shabani
  • 1,654
  • 2
  • 20
  • 30
9
votes
3 answers

Symfony2: SonataAdminBundle - How can i get the object representing the current user inside an admin class?

I use the sonata-admin bundle. I have the relationship with the user (FOSUserBundle) in the PageEntity. I want to save the current user which create or change a page. My guess is get the user object in postUpdate and postPersist methods of the…
user3342506
  • 159
  • 1
  • 2
  • 8
9
votes
3 answers

symfony2 : using referer after login with fosuserbundle

I've got problem with fosuserbundle to redirect user to the referer after login success app/config/security.yml security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_ADMIN: ROLE_USER …
jimpass
  • 353
  • 2
  • 9