fosuserbundle

FOSFacebookBundle and FOSUserBundle

我只是一个虾纸丫 提交于 2019-12-03 08:30:50
I'm trying to setup FOSFacebookBundle and FOSUserBundle, so users can login with registered accounts or facebook accounts. Here relevant codes: config.yml: fos_user: db_driver: orm firewall_name: public user_class: Fam\DiaBundle\Entity\User from_email: address: info@famdia.com sender_name: Staff registration: confirmation: enabled: true fos_facebook: file: %kernel.root_dir%/../vendor/facebook/src/base_facebook.php alias: facebook app_id: 1234567890 secret: abcdefg1234567890 cookie: true permissions: [email] culture: us_US security.yml # # app/config/security.yml # # services: my.facebook.user:

Adding extended profile entity to FOS UserBundle

放肆的年华 提交于 2019-12-03 08:05:26
I am trying to extend the FOS UserBundle to allow for extended profile entities to hold additional information in addition to the basic UserBundle fields. Because I have multiple types of users on the site I have created separate entities to hold the profile information. I have the entities set up as follows: class UserProfile { /** * @var integer */ private $id; /** * @var integer */ private $userId; /** * @var string */ private $phone; /** * @var string */ private $language; /** * @var string */ private $company; /** * @var string */ private $salutation; /** * @var string */ private $fax; /*

FOSUserBundle group role setup

你说的曾经没有我的故事 提交于 2019-12-03 06:43:52
I am using the FOSUserBundle and the Group option. Registration works. Creation of groups works too. If I create 2 groups, admin and client and MANUALLY add a:1:{i:0;s:10:"ROLE_ADMIN";} to the admin group in the fos_group table and then MANULLY setup and entry in the fos_user_user_group that ties an user to the admin group, logging in with that user will be able to log in as an admin. However, there are, obviously, some disadvantages to this method. What can I use to add an user to a group now? Using the promote command-line option will just add the role to that user but in the fos_user table,

Creating a new user with FOSUserBundle fails

只谈情不闲聊 提交于 2019-12-03 06:28:32
问题 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 user by registering over the webinterface I get this: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null Logging in with an already existing user works. Also updating a profile and changing the password. Just creating

Symfony 2 FOS User Bundle Bootstrap modal AJAX Login

爷,独闯天下 提交于 2019-12-03 06:07:27
Has anyone already built a login form inside a Bootstrap modal with Symfony 2 and FOS User Bundle ? Here is what I have now : src/Webibli/UserBundle/Resources/config/service.yml authentication_handler: class: Webibli\UserBundle\Handler\AuthenticationHandler arguments: [@router, @security.context, @fos_user.user_manager, @service_container] app/config/security.yml form_login: provider: fos_userbundle success_handler: authentication_handler failure_handler: authentication_handler src/Webibli/UserBundle/Handler/AuthenticationHandler.php <?php namespace Webibli\UserBundle\Handler; use Symfony

How to set a login form for admins and another for other users using FOSUserBundle?

孤者浪人 提交于 2019-12-03 03:57:09
问题 When having a backend for admin users, it is interesting to have a login form, and at the same time having a normal login form for normal users in the public area of our website. Is that possible using FOSUserBundle? How can it be done "the Symfony2" way? 回答1: First we need to configure some special routes for the admin area: admin_login: pattern: /admin/login defaults: { _controller: FOSUserBundle:Security:login } admin_login_check: pattern: /admin/login_check defaults: { _controller:

How to install SonataDoctrineMongoDBAdminBundle properly?

走远了吗. 提交于 2019-12-03 03:40:42
I am really getting nervous because of lacking of enough resource for installing SonataDoctrineMongoDBAdminBundle and it's dependencies like sonataUserBundle. I have been trying to install this bundle for 15 days. I did everyting agaian and again what telling in sonata's official page. But it does not work properly. After extending sonataUserBundle as ApplicationUserBundle my final documents are: User.php <?php /** * This file is part of the <name> project. * * (c) <yourname> <youremail> * * For the full copyright and license information, please view the LICENSE * file that was distributed

Adding new FOSUserBundle users to a default group on creation

点点圈 提交于 2019-12-03 03:16:21
I'm building my first serious Symfony2 project. I'm extending the FOSUserBundle for my user/group management, and I'd like new users to be automatically added to a default group. I guess you just have to extend the User entity constructor like this : /** * Constructor */ public function __construct() { parent::__construct(); $this->groups = new \Doctrine\Common\Collections\ArrayCollection(); // Get $defaultGroup entity somehow ??? ... // Add that group entity to my new user : $this->addGroup($defaultGroup); } But my question is how do I get my $defaultGroup entity in the first place? I tried

FOSUserBundle and remember me

╄→гoц情女王★ 提交于 2019-12-03 03:04:37
I'm using a FOSUserBundle for authentication in Symfony2. Everything works fine except "remember me". My security.yml looks like this: security: providers: fos_userbundle: id: fos_user.user_manager encoders: 'FOS\UserBundle\Model\UserInterface': sha512 firewalls: main: pattern: ^/ form_login: provider: fos_userbundle logout: true anonymous: true remember_me: key: aSecretKey lifetime: 3600 path: / domain: ~ access_control: - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY

Events FOSUserBundle Symfony2 on register and login

空扰寡人 提交于 2019-12-03 00:39:14
I'm trying to implement events on FOSUserBundle <?php namespace EasyApp\UserBundle\Service; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Doctrine\Bundle\DoctrineBundle\Registry as Doctrine; use EasyApp\UserBundle\Entity\UserLogin; use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\Event\FormEvent; use FOS\UserBundle\FOSUserBundle; class LoginManager implements EventSubscriberInterface { /** @var \Symfony\Component\Security\Core\SecurityContext */ private $securityContext; /** @var \Doctrine\ORM\EntityManager */