2017 © Pedro Peláez
 

silverstripe-module silverstripe-facebookconnect

Integration of Facebook Connect into SilverStripe

image

wilr/silverstripe-facebookconnect

Integration of Facebook Connect into SilverStripe

  • Tuesday, December 6, 2016
  • by wilr
  • Repository
  • 9 Watchers
  • 45 Stars
  • 3,342 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 26 Forks
  • 2 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Facebook Connect Integration Module

Maintainer Contact

  • Will Rossiter

Requirements

  • SilverStripe 3.1

Overview

The module provides a basic interface for implementing the Facebook PHP SDK on your SilverStripe website. The Facebook SDK allows users to login to your website using their Facebook account details, creating a single sign-on within the existing SilverStripe member system., (*1)

What it provides

  • Loads the Facebook PHP SDK., (*2)

  • Provides $FacebookLoginLink template variable to generate a link to login to Facebook. Upon clicking the link and being redirected back to your application the SilverStripe Member::currentUser() will be populated with a Member instance linked to the users Facebook profile., (*3)

<% with CurrentMember %>
    $Name $Avatar(small)
<% end_with %>

Installation

composer require "wilr/silverstripe-facebookconnect" "dev-master"

Register your website / application with Facebook., (*4)

Set your configuration through the SilverStripe Config API. For example I keep my configuration in mysite/_config/facebookconnect.yml file:, (*5)

FacebookControllerExtension:
  app_id: 'MyAppID'
  api_secret: 'Secret'

Update the database by running /dev/build to add the additional fields to the Member table and make sure you ?flush=1 when you reload your website., (*6)

<a href="$FacebookLoginLink">Login via Facebook</a>

You can also access the Facebook PHP SDK in your PHP code.., (*7)

// https://developers.facebook.com/docs/php/FacebookSession/4.0.0
$session = Controller::curr()->getFacebookSession();

For more information about what you can do through the SDK see:, (*8)

https://developers.facebook.com/docs/reference/php/4.0.0, (*9)

Options

All the following values are set either via the Config API like follows, (*10)

Config::inst()->update('FacebookControllerExtension', '$option', '$value'), (*11)

Or (more recommended) through the YAML API, (*12)

FacebookControllerExtension: option: value, (*13)

app_id

Your app id. Found on the Facebook Developer Page., (*14)

api_secret

Facebook API secret. Again, from your Application page., (*15)

create_member

Optional, default: true, (*16)

Whether or not to create a Member record in the database with the users information. If you disable this, ensure your code uses $CurrentFacebookMember rather than $Member. Other access functionality (such as admin access) will not work., (*17)

member_groups

Optional, default '', (*18)

A list of group codes to add the user. For instance if you want every member who joins through facebook to be added to a group Facebook Members set the following:, (*19)

FacebookControllerExtension: member_groups: - facebook_members, (*20)

permissions

Optional, default 'email', (*21)

A list of permission codes you want from the user. Permission codes are listed on developers.facebook.com., (*22)

Ensure you include email in your list if you require create_member., (*23)

facebook_fields

Default 'email','first_name','last_name', (*24)

A list of fields you want to retrieve from Facebook for the user. Available fields are listed on developers.facebook.com., (*25)

Ensure you include email in your list if you require create_member., (*26)

sync_member_details

Optional, default true, (*27)

Flag as to whether to replace user information (such as name) in your database with the values from Facebook., (*28)

License

Released under the BSD-3-Clause License., (*29)

The Versions

06/12 2016

dev-master

9999999-dev https://github.com/wilr/silverstripe-facebookconnect

Integration of Facebook Connect into SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

facebook silverstripe

11/07 2014

1.3.0

1.3.0.0 https://github.com/wilr/silverstripe-facebookconnect

Integration of Facebook Connect into SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

facebook silverstripe

27/01 2014

1.2.x-dev

1.2.9999999.9999999-dev https://github.com/wilr/silverstripe-facebookconnect

Integration of Facebook Connect into SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

facebook silverstripe

12/10 2013

1.1.x-dev

1.1.9999999.9999999-dev https://github.com/wilr/silverstripe-facebookconnect

Integration of Facebook Connect into SilverStripe

  Sources   Download

BSD

The Requires

 

facebook silverstripe

09/04 2013

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/wilr/silverstripe-facebookconnect

Integration of Facebook Connect into SilverStripeK

  Sources   Download

BSD

The Requires

 

facebook silverstripe