2017 © Pedro Peláez
 

symfony-bundle userbundle

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

image

sopinet/userbundle

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

  • Monday, September 21, 2015
  • by hidabe
  • Repository
  • 5 Watchers
  • 2 Stars
  • 457 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Sopinet/UserBundle

Easy Integration:, (*1)

hwi_oauth: https://github.com/hwi/HWIOAuthBundle, (*2)

fosub: https://github.com/FriendsOfSymfony/FOSUserBundle, (*3)

Optional (sonatauser & sonataadmin): https://github.com/sonata-project/SonataUserBundle, (*4)

What it is?

This bundle integrate fosub + hwi_oauth with default options and configuration for only work. You can use it as documentation, guide or use directly in your site., (*5)

Installation

From composer, add, (*6)

{
    "require": {
        "sopinet/userbundle": "dev-master"
    }
}

Add bundle to AppKernel (you can need add FOSUB and SonataUserBundle too), (*7)

 new Sopinet\UserBundle\SopinetUserBundle(),

Configuration

  1. Add configuration / security file by default:
imports
  - { resource: "@SopinetUserBundle/Resources/config/config.yml" }

instead of if you want the same login page for admin and users, then you must import this one:, (*8)

imports
  - { resource: "@SopinetUserBundle/Resources/config/same_login_config.yml" }
  1. Add your id and secret parameters:
parameters:
  sopinet_user_facebook_id: "YOURID-FACEBOOK"
  sopinet_user_facebook_secret: "YOURSECRET-FACEBOOK"
  sopinet_user_google_id: "YOURID-GOOGLE"
  sopinet_user_google_secret: "YOURSECRET-GOOGLE"
  1. It work with SonataUserBundle, overriding user class in app, so, you must have configure integration with FOSUB+SonataUser
fos_user:
  db_driver: orm
  firewall_name: main
  user_class: Application\Sonata\UserBundle\Entity\User
  1. In your Application\Sonata\UserBundle\Entity\User you must have one field ProfilePicture:
    /** @ORM\Column(name="profilepicture", type="string", length=500, nullable=true) */
    protected $profilepicture;
    /**
     * Set profilepicture
     *
     * @param string $profilepicture
     * @return User
     */
    public function setProfilePicture($profilepicture)
    {
      $this->profilepicture = $profilepicture;
        return $this;
    }
    /**
     * Get profilepicture
     *
     * @return string
     */
    public function getProfilePicture()
    {
        return $this->profilepicture;
    }

And it must be defined in User.orm.xml, (*9)

    <field name="profilepicture" column="profilepicture" type="string" length="500" nullable="true"></field>

Usage

    <a href="{{ hwi_oauth_login_url('google') }}">Connect with Google</a>
    <a href="{{ hwi_oauth_login_url('facebook') }}">Connect with Facebook</a>

The Versions

21/09 2015

2.1.x-dev

2.1.9999999.9999999-dev

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

  Sources   Download

MIT

The Requires

 

oauth symfony2 login

16/09 2015

2.2.x-dev

2.2.9999999.9999999-dev

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

  Sources   Download

MIT

The Requires

 

oauth symfony2 login

10/04 2015

dev-master

9999999-dev

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

  Sources   Download

MIT

The Requires

 

oauth symfony2 login

26/02 2015

2.0.x-dev

2.0.9999999.9999999-dev

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

  Sources   Download

MIT

The Requires

 

oauth symfony2 login

10/11 2014

1.2.x-dev

1.2.9999999.9999999-dev

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

  Sources   Download

MIT

The Requires

 

oauth symfony2 login

24/03 2014

dev-vextend

dev-vextend

Easy integration sample, fosuser+hwi_oauth+sonatauser for Symfony2

  Sources   Download

MIT

The Requires

 

oauth symfony2 login