fosuserbundle

FOSUserBundle not found in appkernel

流过昼夜 提交于 2019-12-03 15:41:28
I am using symfony on Windows and I tried to configure FOSUserBundle as described in the official documentation. I get this error when try to update the schema: Class 'FOS\UserBundle\FOSUserBundle' not found in app/AppKernel.php line 20; searched for the problem and find this solution: adding this to autoload.php $loader->registerNamespaces(array( //all the rest 'FOS' => $vendor_dir . '/bundles', )); but it returns another error which says call to undefined method ...\ClassLoader::RegisterNamespace() in ...\autoload.php on line 13 can anybody plz tell me what should i do?:| and this is my

RegistrationFormType::buildForm() not compatible

笑着哭i 提交于 2019-12-03 14:32:16
I just upgrade my Symfony 2.0.12 project to 2.1. I also installed FosUserBundle, but when I run command php composer.phar update then composer output an error: Loading composer repositories with package information Updating dependencies Writing lock file Generating autoload files PHP Fatal error: Declaration of User\UserBundle\Form\Type\RegistrationFormType::buildForm() must be compatible with that of Symfony\Component\Form\FormTypeInterface::buildForm() in /home/mark/dev/proj/src/User/UserBundle/Form/Type/RegistrationFormType.php on line 38 Fatal error: Declaration of User\UserBundle\Form

FOSUserBundle and ACL Business Role

守給你的承諾、 提交于 2019-12-03 14:29:26
I started to learn Symfony 2 this weekend. I faced no problem, as the framework is well documented in my opinion. I'm using FOSUserBundle package for ACL. I'm wondering if it's possible to make it similar to Yii framework: $bizRule='return Yii::app()->user->id==$params["post"]->authID;'; $task=$auth->createTask('updateOwnPost','update a post by author himself',$bizRule); $task->addChild('updatePost'); You may see all details on the snippet above. How can I achieve something similar with Symfony 2? Is this possible? Symfony2 has an ACL system out of the box that will do this. I'm including the

FOSUserBundle and remember me

时光总嘲笑我的痴心妄想 提交于 2019-12-03 13:38:45
问题 I'm using a FOSUserBundle for authentication in Symfony2. Everything works fine except "remember me". My security.yml looks like this: security: providers: fos_userbundle: id: fos_user.user_manager encoders: 'FOS\UserBundle\Model\UserInterface': sha512 firewalls: main: pattern: ^/ form_login: provider: fos_userbundle logout: true anonymous: true remember_me: key: aSecretKey lifetime: 3600 path: / domain: ~ access_control: - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^

Assign a Role with FosUserBundle

冷暖自知 提交于 2019-12-03 13:10:11
问题 I'm really new to Symfony, I'm trying to register a ROLE to a User with FosUserBundle but I can't manage how to do it. Actually I integrated also PUGXMultiUserBundle in order to have two different form for two different roles. Can anyone help me? Thanks in advance --UPDATE-- I report my code in order to explain clearly. I create this files with the guide of PUGXMultiUserBundle This is my entity: //C:\BitNami\wampstack-5.4.23-0\frameworks\symfony\src\Acme\ManagementBundle\Entity

Adding new FOSUserBundle users to a default group on creation

感情迁移 提交于 2019-12-03 13:01:43
问题 I'm building my first serious Symfony2 project. I'm extending the FOSUserBundle for my user/group management, and I'd like new users to be automatically added to a default group. I guess you just have to extend the User entity constructor like this : /** * Constructor */ public function __construct() { parent::__construct(); $this->groups = new \Doctrine\Common\Collections\ArrayCollection(); // Get $defaultGroup entity somehow ??? ... // Add that group entity to my new user : $this->addGroup(

Force reauthentication after user permissions have been changed

不羁岁月 提交于 2019-12-03 12:42:57
In my application I can change user permissions and roles in backend. When a user is logged in and I remove a role of the user, the user can still access content which he actually is not permitted to access anymore, because he is missing the role. The changes take effect only when the user reauthenticates himself with logout/login. So my question is, can I access the session of a logged in user (not me)? I know I can access my own session and destroy it which forces me to login again. But I want to get the session of any user who is logged in. Is this possible? I could not find any resources

FOSOAuthServerBundle with FOSUserBundle - How to make it works?

心不动则不痛 提交于 2019-12-03 10:12:40
问题 Currently my project works very well. I use FOSUserBundle for the management of my users. Now, I want to implement OAuth, so I'm using FOSOAuthServerBundle. Most of developers recommend this bundle for implement OAuth. I followed the documentation of FOSOAuthServerBundle. Normally, I have to add more information in my security.yml but I don't know exactly what I have to do ... Here is my security.yml : security: encoders: Symfony\Component\Security\Core\User\User: plaintext Moodress\Bundle

Events FOSUserBundle Symfony2 on register and login

我与影子孤独终老i 提交于 2019-12-03 10:09:03
问题 I'm trying to implement events on FOSUserBundle <?php namespace EasyApp\UserBundle\Service; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Doctrine\Bundle\DoctrineBundle\Registry as Doctrine; use EasyApp\UserBundle\Entity\UserLogin; use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\Event\FormEvent; use FOS\UserBundle\FOSUserBundle; class LoginManager implements EventSubscriberInterface { /** @var \Symfony\Component

Symfony2: How to make username of FOSUserBundle user unique

99封情书 提交于 2019-12-03 08:52:40
Hi I have my own User Class, wich inherits FOS\UserBundle\Entity\User . Additionally I wrote my own registration routine. Now I have the problem that the form does not make sure that the username is unique. I always get SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'myusername' for key 'UNIQ_2DA1797792FC23A8' I tried adding the @UniqueEntity("email") annotation as stated in the documentation[1], but without any effect. Someone knows what might be wrong? [1] http://symfony.com/doc/current/reference/constraints/UniqueEntity.html The constraint exists in the FOS bundle