properties for user oauth
This commit is contained in:
parent
6424c3738e
commit
627a1de48f
|
@ -107,13 +107,13 @@ hwi_oauth:
|
|||
scope: "email"
|
||||
options:
|
||||
csrf: true
|
||||
facebook:
|
||||
type: facebook
|
||||
client_id: "%facebook_id%"
|
||||
client_secret: "%facebook_secret%"
|
||||
scope: "email"
|
||||
options:
|
||||
csrf: true
|
||||
# facebook:
|
||||
# type: facebook
|
||||
# client_id: "%facebook_id%"
|
||||
# client_secret: "%facebook_secret%"
|
||||
# scope: "email"
|
||||
# options:
|
||||
# csrf: true
|
||||
twitter:
|
||||
type: twitter
|
||||
client_id: "%twitter_id%"
|
||||
|
@ -121,3 +121,10 @@ hwi_oauth:
|
|||
scope: "email"
|
||||
options:
|
||||
csrf: true
|
||||
disqus:
|
||||
type: disqus
|
||||
client_id: "%disqus_id%"
|
||||
client_secret: "%disqus_secret%"
|
||||
scope: "email"
|
||||
options:
|
||||
csrf: true
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
hwi_oauth_login:
|
||||
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
|
||||
prefix: /login
|
||||
|
||||
hwi_oauth_redirect:
|
||||
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
|
||||
prefix: /connect
|
||||
|
@ -6,12 +10,8 @@ hwi_oauth_connect:
|
|||
resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
|
||||
prefix: /connect
|
||||
|
||||
hwi_oauth_login:
|
||||
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
|
||||
prefix: /login
|
||||
|
||||
facebook_login:
|
||||
path: /login/check-facebook
|
||||
#facebook_login:
|
||||
# path: /login/check-facebook
|
||||
|
||||
google_login:
|
||||
path: /login/check-google
|
||||
|
|
|
@ -8,6 +8,22 @@ security:
|
|||
fos_userbundle:
|
||||
id: fos_user.user_provider.username
|
||||
firewalls:
|
||||
secured_area:
|
||||
anonymous: ~
|
||||
logout_on_user_change: true
|
||||
oauth:
|
||||
resource_owners:
|
||||
# facebook: "/login/check-facebook"
|
||||
google: "/login/check-google"
|
||||
disqus: "/login/check-disqus"
|
||||
twitter: "/login/check-twitter"
|
||||
# my_custom_provider: "/login/check-custom"
|
||||
login_path: /login
|
||||
use_forward: false
|
||||
failure_path: /login
|
||||
|
||||
oauth_user_provider:
|
||||
service: my.oauth_aware.user_provider.service
|
||||
# disables authentication for assets and the profiler, adapt it according to your needs
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
|
@ -26,24 +42,6 @@ security:
|
|||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
|
||||
#http_basic: ~
|
||||
|
||||
secured_area:
|
||||
anonymous: ~
|
||||
logout_on_user_change: true
|
||||
oauth:
|
||||
resource_owners:
|
||||
facebook: "/login/check-facebook"
|
||||
google: "/login/check-google"
|
||||
# disqus: "/login/check-disqus"
|
||||
# my_custom_provider: "/login/check-custom"
|
||||
twitter: "/login/check-twitter"
|
||||
login_path: /login
|
||||
use_forward: false
|
||||
failure_path: /login
|
||||
|
||||
oauth_user_provider:
|
||||
service: my.oauth_aware.user_provider.service
|
||||
|
||||
role_hierarchy:
|
||||
ROLE_ADMIN: ROLE_USER
|
||||
ROLE_SUPER_ADMIN: ROLE_ADMIN
|
||||
|
|
|
@ -38,8 +38,8 @@ services:
|
|||
class: HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider
|
||||
arguments:
|
||||
- '@fos_user.user_manager'
|
||||
- ['pass properties as array']
|
||||
- ['@fos_user.user_manager', { google: googleId , twitter: twitterId, disqus: disqusId}]
|
||||
|
||||
my.custom.user_provider:
|
||||
class: MyBundle\Security\Core\User\MyFOSUBUserProvider
|
||||
arguments: ['@fos_user.user_manager', { facebook: facebook_id }]
|
||||
arguments: ['@fos_user.user_manager', { facebook: facebook_id ,twitter: twitterId, disqus: disqusId }]
|
||||
|
|
|
@ -43,7 +43,7 @@ class Product {
|
|||
*/
|
||||
private $user;
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\User", mappedBy="product")
|
||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductSold", mappedBy="product")
|
||||
*/
|
||||
private $productsSold;
|
||||
|
||||
|
@ -169,4 +169,44 @@ class Product {
|
|||
public function getStockCount() {
|
||||
return $this->stockCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->productsSold = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add productsSold.
|
||||
*
|
||||
* @param \AppBundle\Entity\User $productsSold
|
||||
*
|
||||
* @return Product
|
||||
*/
|
||||
public function addProductsSold( \AppBundle\Entity\User $productsSold ) {
|
||||
$this->productsSold[] = $productsSold;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove productsSold.
|
||||
*
|
||||
* @param \AppBundle\Entity\User $productsSold
|
||||
*
|
||||
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
|
||||
*/
|
||||
public function removeProductsSold( \AppBundle\Entity\User $productsSold ) {
|
||||
return $this->productsSold->removeElement( $productsSold );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get productsSold.
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getProductsSold() {
|
||||
return $this->productsSold;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,15 @@ class User extends BaseUser {
|
|||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="twitter_id", type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $twitterId;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="disqus_id", type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $disqusId;
|
||||
/**
|
||||
* @ORM\Column(name="google_id", type="string", length=255, nullable=true)
|
||||
*/
|
||||
|
@ -305,4 +314,48 @@ class User extends BaseUser {
|
|||
public function getActiveFestival() {
|
||||
return $this->activeFestival;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set twitterId.
|
||||
*
|
||||
* @param string|null $twitterId
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function setTwitterId( $twitterId = null ) {
|
||||
$this->twitterId = $twitterId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get twitterId.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTwitterId() {
|
||||
return $this->twitterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set disqusId.
|
||||
*
|
||||
* @param string|null $disqusId
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function setDisqusId( $disqusId = null ) {
|
||||
$this->disqusId = $disqusId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get disqusId.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDisqusId() {
|
||||
return $this->disqusId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,15 @@ class User extends BaseUser {
|
|||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="twitter_id", type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $twitterId;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="disqus_id", type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $disqusId;
|
||||
/**
|
||||
* @ORM\Column(name="google_id", type="string", length=255, nullable=true)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue