fosuserbundle

AclVoter denies access to 'LIST'

随声附和 提交于 2019-12-12 03:54:00
问题 As soon as I set sonata_admin.security.handler to sonata.admin.security.handler.acl the only user who has access is the one with ROLE_SUPER_ADMIN. I think I configured everything right, obviously not. I tried: to give the user the real role ROLE_VIP_CONTACT_ADMIN instead of assigning by a fos_group, no success. all options for security.access_decision_manager.strategy : affirmative, consensus and unanimous to delete all acl tables, acl:init, sonata:admin:setup-acl, with and without sonata

Adding new email translation in FOSUserBundle

和自甴很熟 提交于 2019-12-12 03:49:11
问题 I have add a new translation field, email ,in FOSUserBundle as follows: security: login: email: Email username: Username password: Password remember_me: Remember me submit: Log in All the translation files are in src/UserBundle/Resources/translations . My login.html.twig file looks like: {% extends "UserBundle::layout.html.twig" %} {% trans_default_domain 'FOSUserBundle' %} {% block fos_user_content %} {% if error %} <div>{{ error.messageKey|trans(error.messageData, 'security') }}</div> {%

Login and register in same page with FOSUserBundle

我只是一个虾纸丫 提交于 2019-12-12 03:34:33
问题 I am using login and register in same page with fosuserBundle in my Symfony application.Login work perfect but register does not work.When I click button register I redirected to login.No registration in my database. This is my login.html.twig: {% extends "FOSUserBundle::layout.html.twig" %} {% trans_default_domain 'FOSUserBundle' %} {% block fos_user_content %} {% if error %} <div>{{ error.messageKey|trans(error.messageData, 'security') }} </div> {% endif %} <div class="login-container">

redirect to a different homepage following user role using FOSUserBundle

倖福魔咒の 提交于 2019-12-12 03:27:15
问题 In my Symfony application I am using the FOSUserBundle. It's an application involved two main Roles of User: Factory as ROLE_FACTORY and Custommer as ROLE_CUSTOMER . I have a main page for non-connected user, it's the home page of the application. But when User is going to be connected or is connected, following the role he has, the home page has to change. So the fos user login action have to redirect to the right page. ROLE_FACTORY have to be redirect to the factory_homepage route. ROLE

How to pass user informations to a template using Symfony2 and FosUserBundle

一笑奈何 提交于 2019-12-12 03:18:31
问题 I'm using symfony2, I installed FosUserBundle and I created a bundle UserBundle as indicated in the FosUserBundle online docs. so far so good. I also created another controller and I'm able to access the logged user information in this way: $user = $this->container->get('security.context')->getToken()->getUser(); now imagine that in my website, for all the pages/controller, I need to display some user information, even a simple "Welcome MyUser" at the top of the page (so in base.html.twig). I

Change Symfony2 FOSUserBundle registration form POST parameters?

和自甴很熟 提交于 2019-12-12 03:15:44
问题 This is how the registration form of FOSUserBundle looks like: <form action="/Symfony/web/signup/" method="POST" class="fos_user_registration_register"> <div id="fos_user_registration_form"> <input type="hidden" id="fos_user_registration_form__token" name="fos_user_registration_form[_token]" value="c248f3ef17b082803ae9948c03d137c380f0dc24"/> <div> <label for="fos_user_registration_form_username">Username:</label><input type="text" id="fos_user_registration_form_username" name="fos_user

Symfony2 : Checking for old ROLE returns true

落爺英雄遲暮 提交于 2019-12-11 22:51:37
问题 I am using FOSUserBundle for my symfony2 project. Upon registration, I check with the function below if the user has the default role ROLE_USER that FOSUB gives. /** * Returns true if user has ROLE_USER * * @return boolean */ public function hasDefaultRole() { return ($this->hasRole('ROLE_USER')); } If this function returns true, I set up a new account registration form and on submit the roles are changed and ROLE_USER is removed. EDIT : $user = $this->container->get('security.context')-

Symfony 2 : CSS and JS not loaded using FosUserBundle routing (Bad links)

会有一股神秘感。 提交于 2019-12-11 20:32:38
问题 *Hello there, I come here cause i found 0 solutions from now ... I started using FosUserBundle and was enjoying the functionalities ! But cause there is a but ... :p When i try to go in the login page it's ok : app_dev.php/login Now i try all the other links : /profile - /register - /resetting no one can load css and js ... So i search why and i find this : From /login i need to do ../css/images or ../js/vendor for exemple From /register or the two other links i need to do ../../css/images or

FOSUserBundle - Registration controller override error

僤鯓⒐⒋嵵緔 提交于 2019-12-11 18:32:06
问题 I am trying to override the registration controller of FOSUserBundle. Here's my configuration : services: project.registration.controller: class: Project\UserBundle\Controller\RegistrationController arguments: [ @event_dispatcher,@fos_user.registration.form.factory,@fos_user.user_manager,@security.token_storage] And the controller so far: <?php namespace Project\UserBundle\Controller; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation

FOSUserBundle, EventListener registration user

笑着哭i 提交于 2019-12-11 17:24:58
问题 I'm working on the FOSUserBundle, on EventListener for RegistrationUser. In this bundle, when I create a user, I use a method updateUser() (in Vendor...Model/UserManagerInterface). This method seems to be subject to an EventListener that triggers at least two actions. Registering the information entered in the database. And sending an email to the user to send him login credentials. I found the method that send the mail. By cons, I didn't find the one who makes the recording. I also didn't