fosuserbundle

FOSUserBundle with multiple entity managers - Symfony 2 set up

我的未来我决定 提交于 2019-12-11 12:19:39
问题 I've been using the FOSUserBundle and the FOSOAuthBundle without issue in a project for a while now, but I've recently added another DB connection and another entity manager and, as a result, can no longer rely on auto_mapping. I've added mapping for both of the bundles to one of the entity managers and everything seemed to be working OK. However I've found an issue with the User no longer generating the correct schema when running app/console doctrine:schema:create , suggesting a mapping

Symfony2 FosUserBundle customize Login query

百般思念 提交于 2019-12-11 12:12:45
问题 i'm using FosUserBundle in my Symfony2 project, i have the login working, i want to now further customize login to include checking for id along with username, email and password. i have a User entity in the Entity folder, i have a UserRepository in the Repository folder How do i customize Fos UserBundle login to include id in its query What are the list of possible different ways i could do this any other suggestion to improve code are welcomed -thankyou The User Entity: <?php namespace

How to override register form FosUserBundle?

风流意气都作罢 提交于 2019-12-11 11:44:38
问题 I want to override some of FOSUserBundle forms ( registration form ) So I followed the documentation and I cant understand why I keep getting the same error : Attempted to load class "RegistrationFormType" from namespace "OC\UserBundle\Form\Type". Did you forget a "use" statement for "FOS\UserBundle\Form\Type\RegistrationFormType"? 500 Internal Server Error - ClassNotFoundException. These are my files: RegistrationFormType.php: <?php namespace OC\UserBundle\Form\Type; use Symfony\Component

Service not triggered : The controller must return a response (null given)

我的未来我决定 提交于 2019-12-11 11:06:19
问题 Hi everyone and huge thanks for the help, I am trying to get FOSFacebook work, but it seems to be impossible until now. I tried a lot of configuration, and a lot of fix but nothing worked for me. Here is my configuration : security.yml chain_provider: chain: providers: [fos_userbundle, fos_facebook_provider] fos_userbundle: id: fos_user.user_provider.username fos_facebook_provider: id: fos.facebook.custom_provider firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false

FOS User Bundle get POST Data from Login

落爺英雄遲暮 提交于 2019-12-11 10:38:14
问题 I'm trying to integrate the new Google recaptcha into the FOS User Bundle Login. I've successfully overwritten the login template and the SecurityController form FOS where the loginAction() happens. The problem I'm facing is that I can't access the send POST Data from the Login Form anywhere in the Controller. I tried it in the loginAction() and in the checkAction() , neither of them had the POST Data in the request. So I'm guessing that there's a service, listener or something else that does

FOSUserBundle (login / register) + AJAX + Symfony2

白昼怎懂夜的黑 提交于 2019-12-11 10:13:42
问题 I installed FOSUserBundle on my Symfony2 website and I overwrited the login and register pages. It's working very well, but now, I have another issue : Making a pop up with an AJAX check for the login and register part, working with the different routes, controllers, etc. How to do that the best way ? My pop up is a simple bootstrap modal of login.html.twig page for FOSUserBundle , here is the code of the modal-body for the login part (I will use the register form for the register part) :

Symfony2 + FOS using simple_form authenticator

梦想与她 提交于 2019-12-11 10:05:13
问题 I use FriendsOfSymfony UserBundle. It works when I set everything in firewall as form_login , but if I set it to simple_form to use Custom Authenticator then it let's me login even if the account is locked or disabled. I want to check if the user comes from the correct IP, that's why I created the custom authenticator, but it seems that some authentication coming from FOS is not processed this way. How can I use simple_form with custom authenticator while still keeping full functionality of

FOSUserBundle: Get EntityManager instance overriding Form Handler

白昼怎懂夜的黑 提交于 2019-12-11 09:37:24
问题 I am starting with Symfony2 and I am trying to override FOS\UserBundle\Form\Handler\RegistrationFormHandler of FOSUserBundle. My code is: <?php namespace Testing\CoreBundle\Form\Handler; use FOS\UserBundle\Model\UserInterface; use FOS\UserBundle\Form\Handler\RegistrationFormHandler as BaseHandler; use Testing\CoreBundle\Entity\User as UserDetails; class RegistrationFormHandler extends BaseHandler { protected function onSuccess(UserInterface $user, $confirmation) { // I need an instance of

FOSUser Bundle Adding PlaceHolder to form element

我是研究僧i 提交于 2019-12-11 09:15:21
问题 I understand that when you are overriding FOSUser Bundle Forms, you follow this structure; {{ form_widget(form.plainPassword.first, { 'attr': {'class': 'myformclass'} }) }} I also want to add PlaceHolder option to my form element.. How can i do that? so it will look like something like this; <input class="myformclass" placeholder="Password" type="password" id="password" name="_password" required="required" /> 回答1: {{ form_widget(form.plainPassword.first, { 'attr': {'class': 'myformclass',

exception `Unable to find entity` after the addition of FOSUserBundle

萝らか妹 提交于 2019-12-11 09:08:15
问题 I follow steps from my book (based on symfony 2.0.10, I'm using Symfony2.6.1 with FOSUB 2.0). I build project with CRUD that display data from db just fine (Mountain controller inside My/BackendBundle). Then I want display project only for logged user admin (with ROLE_SUPER_ADMIN, that exist in my for_user table inside db with CRUD data). But when openning ../web/ its result exception Unable to find Mountain entity . from Mountain controller showAction($id) #\src\My\BackendBundle\Controller