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
101
votes
3 answers

Accessing the logged-in user in a template

I'm using FOSuserbundle to get started with User registration https://github.com/FriendsOfSymfony/FOSUserBundle I've got it registering / logging in and out. What I want to do now is grab the logged in users data and present it on every page of my…
ed209
  • 11,075
  • 19
  • 66
  • 82
57
votes
8 answers

Remove / Replace the username field with email using FOSUserBundle in Symfony2 / Symfony3

I only want to have email as mode of login, I don't want to have username. Is it possible with symfony2/symfony3 and FOSUserbundle? I read here http://groups.google.com/group/symfony2/browse_thread/thread/92ac92eb18b423fe But then I am stuck with…
Mirage
  • 30,868
  • 62
  • 166
  • 261
47
votes
2 answers

Creating a new user with FOSUserBundle fails

I am trying to create a new user from the command line and get this error: Warning: array_search() expects parameter 2 to be array, null given in /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Model/User.php line 368 When trying to create a…
sprain
  • 7,552
  • 6
  • 35
  • 49
44
votes
7 answers

Symfony2 $user->setPassword() updates password as plain text [DataFixtures + FOSUserBundle]

I'm trying to pre-populate a database with some User objects, but when I call $user->setPassword('some-password'); and then save the user object, the string 'some-password' is stored directly in the database, instead of the hashed+salted…
Rodney Folz
  • 6,709
  • 2
  • 29
  • 38
43
votes
7 answers

Symfony2 AJAX Login

I have an example where I am trying to create an AJAX login using Symfony2 and FOSUserBundle. I am setting my own success_handler and failure_handler under form_login in my security.yml file. Here is the class: class AjaxAuthenticationListener…
leek
  • 11,803
  • 8
  • 45
  • 61
40
votes
3 answers

The service "fos_user.mailer" has a dependency on a non-existent service "templating"

So, the above error has suddenly started happening, after I've been using FOSUserBundle for several Symfony projects. I've tried including the templating service (twice now) and it seems like it's installed fine. Here is my list of requires in my…
Michael Emerson
  • 1,774
  • 4
  • 31
  • 71
40
votes
2 answers

Multiple entity manager for FOSUserBundle

To use different Entity Manager / Connection based on URL in Symfony if fairly easy. With the following routing configuration connection: pattern: /a/{connection} defaults: { _controller: AcmeTestBundle:User:index } and from the following…
37
votes
7 answers

Symfony2: Inject current user in Service

I am trying to inject the currently logged in user into a service. My goal is to extend some twig functionality to output it based on user preferences. In this example I want to output any date function using the user specific Timezone. There…
n0xie
  • 405
  • 1
  • 4
  • 8
37
votes
8 answers

Symfony2: How to get user Object inside controller when using FOSUserBundle?

I'm using FOSUserBundle to authenticate my users. I'm trying to get the user object inside the Controller to register a trip where I should add the user object to this Trip before save. I did not found how to do that because next method where I…
skonsoft
  • 1,786
  • 5
  • 22
  • 43
34
votes
1 answer

How to customize FOS UserBundle URLs

I've installed FOSUserBundle and I'd like to customize the urls to be /account/login, /account/register, /account/logout instead of /login, /register, /logout I know I can modify the routing config of the bundle, but it doesn't seem to be the proper…
petekaner
  • 8,071
  • 5
  • 29
  • 52
30
votes
4 answers

FOSUserBundle redirect from login page after logged in

I simply want that if admin user or front end user try to access login page even after logged in /admin/login (admin user) OR /login (front end user) then they should be redirected back to their related home page like /admin or /
Neeraj
  • 8,625
  • 18
  • 60
  • 89
28
votes
5 answers

FOS UserBundle Unable to login

I'm back with another issue regarding my UserBundle : Everything went perfect while installing and configuring FOS bundle through Symfony2, it even let me create 2 users that were properly inserted into my DB. However, every time I try to login into…
wattever
  • 611
  • 1
  • 7
  • 12
27
votes
2 answers

Symfony 2.7 / 3 - Doctrine: You have requested a non-existent service "fos_user.doctrine_registry"

Doing a composer update today suddenly getting the following error: [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] You have requested a non-existent service "fos_user.doctrine_registry". when composer is executing…
ken
  • 399
  • 1
  • 3
  • 6
26
votes
2 answers

You have requested a non-existent service "security.context"

i create service but it doesn't work services: redirectionListener: class: Front\EcommerceBundle\Listener\RedirectionListener arguments: ["@service_container","@session"] tags: - { name:…
Haythem Hedfi
  • 569
  • 1
  • 5
  • 11
26
votes
6 answers

Add a default role during user registration with FOSUserBundle

Version : Symfony 2.2 I'm trying to add a default role when a user register on my website. I use FOSUserBundle and i see that when a user register the role field is empty in a database. I begin with this huge bundle and it's not very easy to…
Epok
  • 661
  • 1
  • 8
  • 16
1
2 3
99 100