fosuserbundle

Novalidate isn't working on FOS user registration form

六眼飞鱼酱① 提交于 2019-12-06 21:28:29
I overwrote the FOS UserBundle registration form and added the default options: 'attr'=> array('novalidate'=>'novalidate') as answered here (which seems like the right way to go) but for some strange reason the novalidated is added to a div right after the form instead of the form. FormType: <?php namespace AppBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType; use Symfony\Component\OptionsResolver\OptionsResolverInterface; use AppBundle\Services\RolesHelper; class UserType extends BaseType { /** * @var RolesHelper *

HWIOAuthBundle Google login device_id and device_name for a webapp

会有一股神秘感。 提交于 2019-12-06 18:21:54
问题 I am working on a Symfony2 app. I'm using FOSUserBundle to handle authentication and recently integrated it with FOSUserBundle using this tutorial: https://gist.github.com/danvbe/4476697 . The problem is: I can login using the google api on localhost and everything works fine. However when I try to login on a real server I get: Error: invalid_request device_id and device_name are required for private IP: http://<server_ip>/login/check-google Request details: response_type=code scope=https:/

how to get session value inside symfony2 i use fosuserbundle

孤人 提交于 2019-12-06 16:41:55
i'm using fosuserbundle and this is my function inside FOSUBUserProvider class : public function connect(UserInterface $user, UserResponseInterface $response) { // and here i want to get session value like: $session = $request->getSession(); $session->get('value1'); // } you need to inject Session in your Services Declaration, and then add it in constructor of FOSUserProvider class, in services.yml and services section add @session parameters: my_user_provider.class: Auth\UserBundle\Security\Core\User\FOSUBUserProvider services: my_user_provider: class: "%my_user_provider.class%" #this is the

Admin-reviewed registration in Symfony2 / FosUSerBundle

倖福魔咒の 提交于 2019-12-06 13:48:53
问题 I would like to implement the following in my SF2/FOSUserBundle application. The idea is to have users register themselves using a standard registration form. Then they are sent an email with a confirmation link. When the user opens the link, it validates their email address (important). But I'd like the user to not be enabled yet. It would require the action of an admin to enable the user. I managed to have the email confirmation part, which is nice, but when the users open the confirmation

how to overriding fosuserbundle registration form style

房东的猫 提交于 2019-12-06 11:52:17
I want to use bootstrap style apply in fosuserbundle registration form.and the login cant overriding,but because of registration form use "{{ form_widget(form) }}",so I can't overriding it,I use symfony2.2,I also test use form theme,like this {% block form_row %} {% spaceless %} <div class="control-group"> {{ form_label(form, label|default(null),{ 'attr': {'class': 'control-label'} }) }} {{ form_errors(form) }} <div class="controls">{{ form_widget(form) }}</div> </div> {% endspaceless %} {% endblock form_row %} and in form template the code is {% form_theme form with '@user/form/fields.html' %

Change password of another user using FOSUserBundle

喜你入骨 提交于 2019-12-06 10:28:14
问题 I have two roles in my system: users and admins. By default, when someone logs in as an user or an admin, he can modify his own password using the implemented forms of FOSUserBundle. But I'd like to forbid the users to change their own password, having to request it to the admin, so then the admin would reset it, either introducing a new one chosen by the admin, either generating a random one. I'd also like to send and a email to the user telling him that his passwd has changed and he has to

Symfony2, FOSUser, don't login user after reset password

☆樱花仙子☆ 提交于 2019-12-06 10:03:11
问题 I'm working on resetting password system with FosUser, and I don't know how can I remove the auto-login after user changes his password ? Thanks for help, I don't want to override, I change directly FOS files. 回答1: The proper way :) Compiler Passes in Symfony allow you to manipulate other services. In this case you want to override fos_user.listener.authentication to use your custom subscriber instead of the one provided with FOSUserBundle FOS\UserBundle\EventListener\AuthenticationListener .

Login and mantaign session from ios app to a symfony2 web application

不羁岁月 提交于 2019-12-06 08:02:13
问题 I have developed a Web Application using Symfony2. I have used FOSUserBundle for user management and security. Now I am thinking of developing a native iOS APP for my web and don't really know how to approach the issue of creating a session from the APP and mantaign it throughout the interaction user-APP. In other words, I want to make sure that when I do a NSURLRequest , somehow the session token is sent to allow the server relate all of the requests in the same session. Is there anything

Symfony & FOSUserBundle. Customize validation errors on register template

孤街浪徒 提交于 2019-12-06 07:37:04
I was trying to solve my problem: I'm not able to find where the validation errors of register_content.html.twig are defined. I need to know how to show that errors as I would like. Nowadays my Register is looks like: As you can see, there is a ugly validation error. I want to change the tags <div> <ul><li> Las dos contraseñas no coinciden. </li></ul> </div> predefined somewhere, by another. I have overridden the view register_content.html.twig and I can to show that validation errors but not customize it. <div> {{ form_errors(form.email) }} {{ form_errors(form.username) }} {{ form_errors(form

Editing User with error wrongly changes the app.user.username temporarily, how to solve it?

╄→гoц情女王★ 提交于 2019-12-06 06:59:48
问题 We use the Symfony2 framework and FOSUserBundle for our users. So We have our own UserBundle that inherits from FOSUserBundle. The problem is : When we send the form for editing a user with a wrong password, the app.user.username that is displayed in the header changes when it shouldn't since the form isn't correct. Then when we reload the page, the app.user.username has the normal username (since it hasn't changed in the database). The question is, why does the app.user.username changes