fosuserbundle

'FOS\\UserBundle\\FOSUserBundle' not found

只愿长相守 提交于 2019-12-07 23:40:29
in symfony 2.5 I want use FOSUserBundle, I do any steps in github and when try to update schema see this error Fatal error: Class 'FOS\UserBundle\FOSUserBundle' not found in /opt/lampp/htdocs/symfonyTest/app/AppKernel.php on line 23 FOSUserBundle is in vendor/friendsofsymfony/user-bundle/FOS this is my AppKernel $bundles = array( //... other bundles new FOS\UserBundle\FOSUserBundle(), ); and my app/config/config.yml fos_user: db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel' firewall_name: main user_class: Acme\StoreBundle\Entity\User my app/config/security.yml security

FOS/user-bundle ProxyManager\Configuration error

大城市里の小女人 提交于 2019-12-07 23:01:38
问题 After installation of friendsofsymfony/user-bundle I getting this error FatalThrowableError in Configuration.php line 124: Type error: Return value of ProxyManager\Configuration::setGeneratorStrategy() must be an instance of ProxyManager\void, none returned Using Symfony3.2 and PHP 7.1 Maybe have ideas why? EDIT I used This tut https://symfony.com/doc/master/bundles/FOSUserBundle/index.html And choose "Doctrine ORM User class" for user entity 回答1: This is because you are using the incorrect

ACL + SonataAdminBundle + SonataUserBundle

无人久伴 提交于 2019-12-07 18:59:34
问题 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,

How to resolve ServiceCircularReferenceException?

夙愿已清 提交于 2019-12-07 18:23:30
问题 I wanted to inject the current user into an Entity Listener but I ran into an ServiceCircularReferenceException . I know there are other questions dealing with this issue, and one mentioned solution was to inject the entire service_container into the listener, which didn't work. I then stumbled accross a seemingly duplicate question, where the provided accepted answer was to implement a UserCallable. But this again yields in the exact same exception. Could it be that it is due to my

How to check if a username/password combination is valid for FOS UserBundle

谁说胖子不能爱 提交于 2019-12-07 10:08:52
问题 We are currently using Symfony 2 and FOS/UserBundle for user authentication. I want to check if a given username/password combination is valid without logging in. This is because another person is currently logged in but for example needs to do a specific action which needs to be done by someone with a higher clearance. Basically I want another user to do a different controller action besides the person that is currently logged. If there's a better way of doing this please let me know 回答1:

symfony swiftmailer: mail not sent in prod-environment

∥☆過路亽.° 提交于 2019-12-07 09:56:50
问题 I have a symfony 2.8 app, with fosuserbundle implemented. In the dev environment, the registration confirm mails are sent, but not in the prod environment. There is no log message and the smpt configuration is correct. sf version: 2.8.1 swiftmailer-bundle version: current (compatible with sf version; 2.* in composer json) fosuserbundle: 1.3.5 ( * in composer) dev-config: imports: - { resource: config.yml } framework: router: resource: "%kernel.root_dir%/config/routing_dev.yml" #strict

Symfony2 fos login, register and forgot password in one view

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 07:07:23
问题 I need to apply a purchased template to our dashboard. In this template, the login , register and forgot password forms are all under the same view, and switching between them using simple JQuery. I have been looking for a nice, not-too-flashy way of combining all three forms into one, but I came up empty. My standing options (as I see them), and why I don't like any of them: Take the views from the fos bundle, copy them to /app/Resources/FOSUserBundle/views/ , remove the {% extend %} part

Assetic files in symfony are behind the firewall?

守給你的承諾、 提交于 2019-12-07 04:42:38
问题 I have simple login page and security set up like this: firewalls: main: pattern: ^/ form_login: provider: fos_userbundle csrf_provider: form.csrf_provider use_referer: true always_use_default_target_path: true default_target_path: / logout: true anonymous: true access_control: - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/, role: ROLE_ADMIN } And in my

Symfony2: How to restrict / deny access to certain routes by IP address?

拥有回忆 提交于 2019-12-07 03:13:10
问题 I'd like to disallow access to /login and /register if a client's IP address has been banned. The (black-) list of banned IPs is stored in the database. How can I solve this? 回答1: Since symfony 2.4 you can use the Expression Language Component in your config-files. Now implementing a simple IP check is easy: create a service (i.e. access_manager ) with a method (i.e. getBannedIPs() ) that fetches the list of banned IPs from your storage layer Add an expression to your security configuration

Login programmatically and stay logged in

寵の児 提交于 2019-12-07 01:37:03
问题 I'm trying to implement single sign on access to a website using Symfony2. The authentication itself seems to work fine, but only for the initial page. On the next page that is loaded the user is not logged in anymore. Relevant code: $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles()); $event = new InteractiveLoginEvent($request, $token); $this->get("event_dispatcher")->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $event); $this->get("security.context")->setToken($token)