fosuserbundle

Symfony2.5 + FOSUserBundle check path apparently not found

廉价感情. 提交于 2019-12-11 01:38:51
问题 I started a new Symfony app on which I use the FOSUserBundle. I installed it, loaded the bundle and configured it. Here's my configuration.yml : fos_user: db_driver: orm firewall_name: main user_class: Myapp\UserBundle\Entity\User and my security.yml : security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: ROLE_ADMIN providers: fos_userbundle: id: fos_user.user_provider.username in_memory: memory: ~ firewalls: dev: pattern: ^/(_

With Symfony 3, how to display a read-only field as a label ? (in FOSUBundle's registration form)

房东的猫 提交于 2019-12-11 01:27:26
问题 Using Symfony 3 and overridden FOSUserBundle's registration form, I have a readonly field: ->add('name', TextType::class, array('attr' => array('readonly' => true))) For now, it appears as a textbox, but I would like it to appear as a text/label instead. I see nothing such as "LabelType". Is it possible to do this? 回答1: It look like you need customize the appearance of the textbox when it has the readonly attribute. So the simple solution could be a single CSS style: // style.css input

How to override FOSUserBundle/Doctrine/UserManager.php

社会主义新天地 提交于 2019-12-10 22:19:59
问题 I am integrating fileupload system with fosuserbundle I need to override updateUser function in /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Doctrine/UserManager.php I copied this file to /ACME/UserBundle/Doctrine/UserManager.php But it doesn't work. This is my temporary /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Doctrine/UserManager.php public function updateUser(UserInterface $user, $andFlush = true) { $this->updateCanonicalFields($user); $this->updatePassword($user); //it

“Resources are not supported in serialized data.” when using FOSRestBundle and Paginator

喜欢而已 提交于 2019-12-10 22:04:20
问题 I am setting up a REST service for my website with the FOSRestBundle and JMSSerializerBundle. I made a custom method on a entity repository which returns a Paginator object. The method works great when I use it on the normal website, but when I want to use the method with the REST route, this error is thrown (XML or JSON output throws the same error) : "Resources are not supported in serialized data." I really don't know where to search since the error isn't very explicit to me. Here's my

Symfony 2 FOSUserBundle Relation to Products Table

扶醉桌前 提交于 2019-12-10 20:44:36
问题 I apologize in advance if this has been asked before. I have successfully setup FOSUserBundle. I am trying to setup "http://symfony.com/doc/current/book/doctrine.html" the product example from that link out of the documentation. What I would like to do is set it up so a specific user adds a product the User Id of the FOSUser that user is associated with that product. I have two bundles in the Acme folder Acme/UserBundle -> the FOSUser Setup and Acme/MainBundle -> where I am setting up

Symfony: Authentication request failed: Invalid CSRF token

只谈情不闲聊 提交于 2019-12-10 19:57:05
问题 I am getting the following error on logging in to a Symfony2 application: [2014-06-27 00:36:22] security.INFO: Authentication request failed: Invalid CSRF token. [] [] Running on: Symfony2 SonataUserBundle Vagrant (using puppet via Puphpet.com) Safari/OSX Same setting is Working on an Ubuntu host system. Thanks for any help. security.yml: firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false secured_area: pattern: ^/ form_login: provider: fos_userbundle csrf_provider:

Error after Upgrading FOS UserBundle from 1.2 to 2.0 in Symfony 2.1

给你一囗甜甜゛ 提交于 2019-12-10 17:34:50
问题 I have a project in Symfony 2.1, with PropelBundle, and FOS UserBundle. I upgraded FOS UserBundle with Composer from 1.2 to the latest version (2.0) and followed the instruction to delete the "propel_user_class" definition in the app/config/config.yml file as indicated in the Upgrade.md file. My new config is as follows: # FOSUserBundle Configuration fos_user: db_driver: propel firewall_name: main user_class: MyVendor\MyBundle\Model\Member registration: form: type: myvendor_user_registration

SonataAdminBundle can not update the user password

一个人想着一个人 提交于 2019-12-10 17:19:04
问题 I can not update the user password via sonataadmin dashboard. I use symfony2 FosUserBundle2.0 SonataAdminBundle(but not use SonataUserBundle) and follow the Document to do. MyUserBundle\Admin\UserAdmin.php class UserAdmin extends Admin like this protected function configureFormFields(FormMapper $formMapper) { $formMapper ...... ->add('plainPassword', 'repeated', array( 'type' => 'password', 'options' => array('translation_domain' => 'FOSUserBundle'), 'first_options' => array('label' => 'form

Symfony2 (FOSUserBundle) SHA512 hash doesn't match C# SHA512 hash

和自甴很熟 提交于 2019-12-10 17:16:29
问题 I made an account on my web app (Symfony2 with FOSUserBundle) and registered with the password "lolwut" (without the quotes). These are the settings in my security.yml config: security: encoders: FOS\UserBundle\Model\UserInterface: algorithm: sha512 iterations: 1 encode_as_base64: false The resulting data: Hashed password: f57470574dbf29026821519b19539d1c2237e4315d881fa412da978af554740c6b284062a9a4af7d0295d18ebea8ef2e152cf674b283f792fe0b568a93f969cf Salt: kuc5bixg5u88s4k8ggss4osoksko0g8 Now,

Change default Login page in FOSUserBundle (Symfony)

江枫思渺然 提交于 2019-12-10 16:31:42
问题 I think that both the question and the answer here shouldn't be very complicated. I have installed and configured the FOSUserBundle to use in a project with Symfony2. What I need to know is where I tell the Security which page it has to redirect the user when they try to access to a forbidden url. By default it is /login. But I'd like to change it to a more general /main. Thanks in advance 回答1: It's not done by FOSUserBundle, but the Security system in Symfony2. You need to set the following