fosuserbundle

Weird unexpected T_STRING error

依然范特西╮ 提交于 2019-12-05 05:29:48
I have a weird PHP error in a current Symfony2 project: unexpected T_STRING in /blahblah/Foo/BarBundle/Entity/User.php on line 1 This is a pretty standard error, usually linked to a mismatched pair of " or '. But here is the code of the file User.php <?php namespace Foo\BarBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="fos_user") * @ORM\Entity(repositoryClass="Foo\BarBundle\Entity\UserRepository") */ class User extends \FOS\UserBundle\Entity\User { // classic user entity The line <?php is line #1. There is no quotes, and the weird thing comes from the fact

Doctrine doesn't map fields from FOSUserBundle User class

南笙酒味 提交于 2019-12-05 01:45:31
问题 I am using Symfony 2.1 RC1 and the FOSUserbundle on a Windows server running PHP 5.3.13. I have followed the instructions here but Doctrine doesn't create fields in the database for the properties inherited from the base FOS User class (only the fields from my class). Trying to login using the FOS login form produces the error: Unrecognized field: usernameCanonical I have the following Doctrine configuration: # Doctrine Configuration doctrine: dbal: driver: %database_driver% host: %database

HWIOAuthBundle Google login device_id and device_name for a webapp

天涯浪子 提交于 2019-12-05 01:25:02
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://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile redirect_uri

Force reauthentication after user permissions have been changed

自闭症网瘾萝莉.ら 提交于 2019-12-04 21:38: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

FOSUserBundle password validation

独自空忆成欢 提交于 2019-12-04 19:25:36
问题 I'm attempting to override the current validation for passwords in FOSUserBundle. I've tried a few options, but I still can't find the solution. To increase the password's MinLength, I created a validation.yml with: # src/Acme/UserBundle/Resources/config/validation.yml Acme\UserBundle\Entity\User: properties: username: - MinLength: { limit: 3, message: "Your username must have at least {{ limit }} characters." } - MaxLength: { limit: 255, message: "The username is too long" } - NotBlank: {

How to convert sha1() passwords into FOSUserBundle?

三世轮回 提交于 2019-12-04 15:00:58
I have legacy application that keeps passwords encrypted with sha1() function, no salt. Now that site is being converted into Symfony2 and FOSUserBundle, how can I transfer them to new database? i had the same problem just override the encoder like explained by @iamdto # app/config/security.yml security: encoders: FOS\UserBundle\Model\UserInterface: id: your.custom.encoder Your class should be use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface; class CustomEncoder implements PasswordEncoderInterface { public function encodePassword( $raw, $salt ) { //do not use salt here

Symfony2: How to make username of FOSUserBundle user unique

风格不统一 提交于 2019-12-04 13:56:59
问题 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:/

Custom Facebook FOSFacebookBundle Login Button

女生的网名这么多〃 提交于 2019-12-04 12:53:44
some one know how custom/change image of FosFacebook login button ? {{ facebook_login_button({'autologoutlink': true}) }} And redirect on a full page facebook login not on pop-up. This uses a twig helper and render a template with '' notation using facebook sdk js. If you need to redirect to the login-page, use an html link, call the method 'getLoginUrl' from the php facebook sdk You can access to it via the service 'fos_facebook.api' register through FOSFacebookBundle Updated with code examples Here is the javascript code i use to login with facebook 'frictionless' <script> //scopes string

Symfony 2.5.3 and PHP 5.6.0: incompatibility issues?

ⅰ亾dé卋堺 提交于 2019-12-04 12:01:58
问题 I don't know if this is a Symfony issue or a FOSUserBundle issue so I'll report here and hope get some help. I have two development instances: CentOS 6.5, PHP 5.5.16, MySQL 5.5.37 CentOS 7, PHP 5.6.0, MariaDB 5.5.37 I tried the same project in both instances and by same project I mean the same: copied without any vendor and in both instances run "composer update" at first. After composer updates the vendor I tried to access admin area, which is handled by, FOSUserBundle and surprise in the

Symfony2 FosUserBundle and SonataUserBundle : overriding entities?

我的未来我决定 提交于 2019-12-04 11:42:30
I use FosUserBundle and SonataUserBundle for my Symfony2 project. I get confused now. I want to add fields for the entity User but it's not working. There is no update for the schema for example. Here is my config : AppKernel: ... new FOS\UserBundle\FOSUserBundle(), new Sonata\UserBundle\SonataUserBundle(), new Application\Sonata\UserBundle\ApplicationSonataUserBundle('FOSUserBundle') config.yml: ... # FOSUserBundle Configuration fos_user: db_driver: orm # BDD type firewall_name: main # firewall name user_class: Application\Sonata\UserBundle\Entity\User # entity class defined And the User