0

I have two login templates for two different users. I want login 1 to connect only the user of type 1 and login 2 to connect only the user of type 2.

I'm using PUGXMultiUserBundle / FOSUserBundle – Symfony 3.

I configured PUGXMultiUserBundle and overrided the fosuserbundle template and I created two firewall for each user.

I am new to symfony I need a little help how to do this.

lebelinoz
  • 4,890
  • 10
  • 33
  • 56
Dev M
  • 1,519
  • 3
  • 29
  • 50
  • I would go with symfony guard instead of `PUGXMultiUserBundle / FOSUserBundle` and just create 2 Authenticators, and to distinguish user I would go with some kind of flag field in user entity or maybe use roles. – kunicmarko20 Sep 16 '17 at 20:50
  • I used PUGXMultiUserBundle to register both users in the database. for the symfony guard how to use it? in my user table I have a 'type' field to distinguish the two users with a 'roles' field – Dev M Sep 16 '17 at 20:58
  • hello, can i use symfony guard with FOSUserBundle ? – Dev M Sep 16 '17 at 21:32

1 Answers1

0

Did this task. I used official documentation. Follow the tutorial and all will be fine.

  • Hello, I have already followed the documentation of PUGXMultiUserBundle my problem is with the login. I tried to do guard Authenticators with FOSUserBundle and i created two Firewalls. but I still have connection problems with the second user. I can not verify if the second user is logged in and have the admin role and both of templates login 1 and 2 allows to pass both types of users. – Dev M Sep 19 '17 at 09:43
  • Maybe this solution help you: https://stackoverflow.com/questions/31749208/symfony-2-with-pugxmultiuserbundle-and-multi-login-form – Maxim Strutinskiy Sep 19 '17 at 11:36