fosuserbundle

Ignore Password when user updates profile with FOSUserBundle

此生再无相见时 提交于 2019-12-06 06:13:03
问题 I am using FOSUserBundle and I am trying to create a page that allows a user to update their user profile. The problem I am facing is that my form does not require that the user reenter their password if they don't want to change/update their password. So when a user submits the form with an empty password the database will be updated with an empty string, and the user will not be able to log in. How can I get my form to ignore updating the password field if it is not set? Below is the code I

Cannot autowire service FOSUserBundle, Symfony 3.4

喜欢而已 提交于 2019-12-06 05:57:52
问题 I'm trying to override the registration controller of my FOSUserBundle. I've followed the steps on https://symfony.com/doc/3.4/bundles/inheritance.html But I get the following error: Cannot autowire service "AppBundle\Controller\RegistrationController": argument "$formFactory" of method "FOS\UserBundle\Controller\RegistrationController::__construct()" references interface "FOS\UserBundle\Form\Factory\FactoryInterface" but no such service exists. You should maybe alias this interface to one of

ACL + SonataAdminBundle + SonataUserBundle

▼魔方 西西 提交于 2019-12-06 05:47:31
In my Symfony2 project I managed to setup FOSUserBundle + SonataUserBundle + SonataAdminBundle following official docs. Now comes the time to setup the ACL (Access control list). What I did : Created an AdminClass called AdminReport app/console sonata:admin:setup-acl install ACL for sonata.admin.report update role: ROLE_SONATA_ADMIN_REPORT_GUEST, permissions: ["LIST"] update role: ROLE_SONATA_ADMIN_REPORT_STAFF, permissions: ["LIST","CREATE"] update role: ROLE_SONATA_ADMIN_REPORT_EDITOR, permissions: ["OPERATOR","EXPORT"] created a new user, granted him with ROLE_SONATA_ADMIN_REPORT_STAFF app

Symfony2 OAuth keeps giving me a login page when a token is provided

拟墨画扇 提交于 2019-12-06 04:32:09
I have setup an app with: FriendsOfSymfony/FOSUserBundle FriendsOfSymfony/FOSOAuthServerBundle FriendsOfSymfony/FOSRestBundle I have successfully created a client and can get an access token using a url like this http://api.mydomain.com/oauth/v2/token?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=password&username=mikebates&password=secret However, when I then try to access the a url like this http://api.mydomain.com/api/surgeries/45/details?access_token=ACCESS_TOKEN I get redirected to the symfony login page, but I can't have that or the mobile app I'm build to consume this REST

How to create “two” (chat and admin) or more secured areas with FOSUserBundle

非 Y 不嫁゛ 提交于 2019-12-06 04:06:47
I'm working in a Symfony 2.8.x app and I need to setup two secured areas: chat and admin . This means that chat and admin will use the same login template (if this is possible and I don't need to setup different one for this purpose). I have googled before ask here and there is a few things related showing up and I read a lot of post about this topic: 1 , 2 , 3 , 4 just as an example of them but I am doing something wrong since I can't get this working properly. This is how /app/config/security.yml looks like (just the firewalls and access_control piece of code): security: .... firewalls:

Easiest way to integrate captcha's into Symfony2 FOSUserBundle registration?

℡╲_俬逩灬. 提交于 2019-12-06 02:57:54
问题 I'm using Symfony2 and the FOSUserBundle to manage registration and logins. I'd like to add a captcha system. Is there are pre-existing bundle or tutorial on this? Of course, I could try to roll my own using Google re-captcha. In that case, is Google reCaptcha a good choice, or should I use some other API? 回答1: There are indeed a bundles for that, take a look at: CaptchaBundle Or EWZRecaptchaBundle Both got (most likely) all the documentation you need added in the README.md file or extended

Bug into fosuserbundle when double click on confirmation link?

故事扮演 提交于 2019-12-06 00:52:48
问题 I just begin to use fosuserbundle, today I activate the confirmation register link. It works great, but if the user click a second time on the confirmation link in the email, he get that error : The user with confirmation token "3hiqollkisg0s4ck4w8g0gw4soc0wwoo8ko084o4ww4sss8o4" does not exist 404 Not Found - NotFoundHttpException I think this error should be handle by the bundle, no ? Thanks 回答1: Here's the code for overriding the action. Basically just copied part of the actual FOS action

symfony2 : using referer after login with fosuserbundle

一个人想着一个人 提交于 2019-12-05 21:56:36
问题 I've got problem with fosuserbundle to redirect user to the referer after login success app/config/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_email firewalls: main: pattern: ^/ form_login: provider: fos_userbundle login_path: fos_user_security_login use_referer: true check_path: fos_user_security_check csrf_provider: form.csrf

How create modal window with Twig template and Twitter-Bootstrap

久未见 提交于 2019-12-05 21:32:44
问题 I use Symfony and boostrap to customize the style of my website. I have a twig file : register_content.html.twig which contains a register form. In my index.html.twig I want to have something like that : <a href="{{ path('fos_user_registration_register') }}" class="btn" data-toggle="modal">Je m'inscris !</a> To display the content of the register form in a modal window, but it doesn't work. I try to use the twitter-bootstrap documentation here : http://bootstrap.braincrafted.com/javascript

How to assign roles on successful registration?

被刻印的时光 ゝ 提交于 2019-12-05 21:21:35
问题 I'm using fos user bundle and pugx multi user bundle. I've read all the documentation and I'm new to Symfony. In the pugx multi user bundle there's a sample on every point but one: sucessful registration. Samples of overriding controllers for generating forms => ok Samples of overriding templates for generating forms => ok Samples of overriding successful registration sample => nothing. Here's my code: class RegistrationController extends BaseController { public function registerAction