fosuserbundle

Symfony fosuserbundle add Account entity to a person entity

会有一股神秘感。 提交于 2019-12-13 17:26:29
问题 I have a Symfony project with FOSUserBundle, i extended the FormType in my personal Bundle following this guide "http://symfony.com/doc/master/bundles/FOSUserBundle/overriding_forms.html" I created a Person entity with first name, last name, adresse ..., created its FormType like this : public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('firstName', TextType::class) ->add('lastName', TextType::class) ->add('adress', TextType::class) ->add('account',

FOSUserBundle force user to write a different password

我与影子孤独终老i 提交于 2019-12-13 16:29:34
问题 I have an application running on Symfony2.0 with FOSUSerBundle. Every 3 months a user who connect the application have to change its password, it's in place and it's working. Today every 3 months if the user write as new password the same as the previous one there is no verification and he can use it 3 more months. I would like to add a constraints on the password reset and force the user to give a different password from the previous one. I have no idea how to do this. I tried to create a

FOS UserBundle - Override the FormFactory

ぃ、小莉子 提交于 2019-12-13 16:23:07
问题 i need some help overriding the FormFactory. My Goal is to change the Profile. So, as i also use Facebook Login, i do not want them to change email, username and password. So i use the ProfileController in my bundle to hand over the current user to the ProfileFormType class. What i'm trying to do is to implement my own FormFactory, so i can set the user and put it into the options array inside the call return $this->formFactory->createNamed($this->name, $this->type, null, array('validation

Duplicated password validation messages ONLY IF new password is 1 char long

99封情书 提交于 2019-12-13 16:09:10
问题 My problem is password validation message appears twice in Registration and Change Password forms. As most posts/solutions points out "groups", how do I implement it into my code below? I tried to implement other solved examples as shown below but I cannot get it working. Maybe because I never worked FOSUserBundle before. FOSUserBundle - Validation for username, password or email fields Duplicated errors for constraints when using several validation groups Symfony2 FOSUserBundle extending

Symfony2 SonataAdminBundle Password field encryption

社会主义新天地 提交于 2019-12-13 14:26:59
问题 I have FOSUserBundle to manage my users, and SonataAdminBundle to manage my website... I have a problem, whenever I try to change/add a password to any user, the password isn't encoded into sha512 , but it does when the user register itself inside fosuserbundle registration page... So there isn't any problem with Symfony2 configuration neither fosuserbundle config, it may be inside SonataAdminBundle somewhere, or maybe into my admin class... <?php // src/Acme/DemoBundle/Admin/PostAdmin.php

FOSUserBundle and ACL Business Role

▼魔方 西西 提交于 2019-12-13 11:45:33
问题 I started to learn Symfony 2 this weekend. I faced no problem, as the framework is well documented in my opinion. I'm using FOSUserBundle package for ACL. I'm wondering if it's possible to make it similar to Yii framework: $bizRule='return Yii::app()->user->id==$params["post"]->authID;'; $task=$auth->createTask('updateOwnPost','update a post by author himself',$bizRule); $task->addChild('updatePost'); You may see all details on the snippet above. How can I achieve something similar with

FOSUserBundle twig form submit not expected behaviour

邮差的信 提交于 2019-12-13 07:46:57
问题 What is up, guys. I'm using PUGXMultiUserBundle on top of FOSUserBundle to register and login two different user entities. Everything is working out of the box: I have my User class extending the base User class from FOSUserBundle and my two entities for both Seller and Customer that extend my User class. I don't want my users to input their username, as email is the prefered login property. So in the setEmail() and setEmailCanonical() methods of my User class, I also set username and

FOSUser on Symfony 3.3

半城伤御伤魂 提交于 2019-12-13 07:30:30
问题 This is similar to Symfony3 You have requested a non-existent service "validator.builder", while add FOSUserBundle, on vanilla Symfon3.3 instead of microkernel (in case that makes differences). Problem: I have a problem trying to set up FOSUser (v.2) on a Symfony 3.3: [Symfony\Component\DependencyInjection\Exception\AutowiringFailedException] Cannot autowire service "validator.builder": argument "$node" of method "Symfony\Component\Config\Definition\Builder\ValidationBuilder::__construct()"

Symfony 2.4/FOSUserBundle - is there a way to hook into the login process programatically?

拟墨画扇 提交于 2019-12-13 06:34:45
问题 I have a working project that uses the FOSUserBundle to handle all things user related, including logging into the system. Now, I'm building an API, and would like users to be able to log into the system by sending their credentials via JSON over HTTPS. I'd also like to be able to use the _remember_me cookie. So, I need to be able to send either those JSON-decoded credentials or the _remember_me cookie to the FOSUserBundle login mechanism, but I'm not quite sure how to do it. Any suggestions

To path the parameter to OAuth facebook login by symfony2/HWIOAuthBundle

狂风中的少年 提交于 2019-12-13 04:50:54
问题 This question is related to this article I have googled many times and made the problem more precisely. My question is very simple. Can I pass the parameter from here (for example : myStatus=1) <a href="{{ path('hwi_oauth_service_redirect', { 'service' : 'facebook' }) }}" />facebook</a> to this class? FOSUBUserProvider class MyUserBundle\Security\Core\User class FOSUBUserProvider extends BaseClass { protected $container; public function __construct(UserManagerInterface $userManager,