fosuserbundle

Sonata User Admin - Custom field dependency

China☆狼群 提交于 2019-12-09 13:42:17
问题 I have extended the SonataAdmin class for FOSUser and added 2 custom fields (choice type from external data source): Company and Sector I'd like to make Sector dependent on Company , so if the user selects a Company it filters the available Sectors. I though about using FormEvents for filtering at page load, but I don't even know how to get the Company value of the current form. Here is a part of my custom SectorType public function buildForm(FormBuilderInterface $builder, array $options) {

Override FOSUserBundle routes Symfony2

那年仲夏 提交于 2019-12-09 13:36:51
问题 I would like to override some routes from FOSUserBundle MyBundle/Resources/config/routing/security.yml fos_user_security_login: path: /{_locale}/login defaults: { _controller: FOSUserBundle:Security:login } requirements: _locale: %locales% fos_user_security_check: path: /login_check defaults: { _controller: FOSUserBundle:Security:check } requirements: _locale: %locales% fos_user_security_logout: path: /{_locale}/logout defaults: { _controller: FOSUserBundle:Security:logout } requirements:

FOSUserBundle admin area not accessible after login

本小妞迷上赌 提交于 2019-12-09 02:00:49
问题 I am using FOSUserBundle for admin section as well as frontend by following the instructions given at: https://github.com/FriendsOfSymfony/FOSUserBundle/issues/849 For frontend everything is working fine but for admin section when i access my admin area /admin then i am redirected to login page /admin/login (that is correct). Once i provide admin username and password then as per the default target path of after login default_target_path: /admin/ defined in security.yml it is redirecting to

FOSUserBundle or PUGXMultiUserBundle to have two different user profiles (Symfony2)

隐身守侯 提交于 2019-12-08 23:32:41
问题 I'm doubtful about how to approach this problem: My Symfony2 app for this issue has two different profiles, name 'em "Seller" and "Buyer". The goal is to keep a bunch of attributes about a "Seller", and, on the other hand, not much about the "Buyer" (email and password would do it). I realise that it's not easy to have two different entities log in and register using FOSUserBundle. There are quite some other bundles, such as PUGXMultiUserBundle that 'hack' FOSUserBundle, and are not easy to

Symfony2 - Doctrine and FOSUserBundle - wrong annotations

元气小坏坏 提交于 2019-12-08 17:28:23
问题 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. <?php namespace Pan100\MoodLogBundle\Entity; use FOS\UserBundle\Entity\User as BaseUser; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="fos_user") */ class User extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id

Unrecognized options “csrf_provider” under “security.firewalls.form_login”

两盒软妹~` 提交于 2019-12-08 17:11:53
问题 I'm trying to install the FOSUserBundle following the tutorial here When I'm at the 7th step I try to update the database schema for ORM running php app/console doctrine:schema:update --force but appears the error InvalidConfigurationException: Unrecognized options "csrf_provider" under "security.firewalls.form_login" Here's my firewall: firewalls: main: pattern: form_login: provider: fos_userbundle csrf_provider: form.csrf_provider logout: true anonymous: true What can I do? I don't set a

HWIOauthBundle & FOSUserBundle events not firing

泄露秘密 提交于 2019-12-08 12:05:57
问题 I have followed all of the advice found here for setting up the HWIOAuthBundle with the FOSUserBundle, but I wish to be able to access the events fired when a user registers and so far seem unable to do that. Having followed the advice in this question, here is my event subscriber (note that I am not interested in all of the events, but I just wanted to test if any of them were being fired): <?php namespace Acme\ClientBundle\EventListener; use FOS\UserBundle\Event\FilterUserResponseEvent; use

Symfony 3 + FOSUserBundle - Overriding template

你。 提交于 2019-12-08 12:04:10
问题 I have installed Symfony 3.2 and FOSUser dev-master. I would like to override FOSUser templates in my custom bundle using my bundle as child of FOSUserBundle. Unfortunatelly this not works.. This overriding way works correctly for controllers, but not for templates.. when I used first way to overriding templates (in app/Resources...) it worked, but second way described in documentations (custom bundle) not works.. Does somebody know why? Doc link: http://symfony.com/doc/master/bundles

Symfony 2.3 FOSUserBundle does not find security.context

£可爱£侵袭症+ 提交于 2019-12-08 11:42:24
问题 I installed the FOS Bundle like mentioned in: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/index.md After installation with composer and setting up the user class i always get: [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] The service "fos_user.security.login_manager" has a dependency on a non-exi stent service "security.context". I checked the existence of the path and there is the contextinterface that is included in the

Symfony2 FOSUserBundle Invitation : only work on owning side associations

a 夏天 提交于 2019-12-08 10:44:14
问题 Entity/User namespace My\SampleBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity * @ORM\Table(name="fos_user") */ class User extends \FOS\UserBundle\Entity\User { /** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\OneToOne(targetEntity="Invitation", inversedBy="user") * @ORM\JoinColumn(referencedColumnName="code") * @Assert\NotNull(message="Your invitation is wrong") *