\ConnectComponent

Summary

Methods
Properties
Constants
initialize()
startup()
registrationData()
user()
role()
roles()
$uid
$me
$hasAccount
$authUser
$noAuth
$errors
$createUser
$model
$plugin
$modelFields
No constants found
No protected methods found
No protected properties found
N/A
__syncFacebookUser()
__runCallback()
__initUserModel()
__error()
No private properties found
N/A

Properties

$uid

$uid

uid is the Facebook ID of the connected Facebook user, or null if not connected

$me

$me

me is the Facebook user object for the connected Facebook user

$hasAccount

$hasAccount

hasAccount is true if the connected Facebook user has an account in your application

$authUser

$authUser

The authenticated User using Auth

$noAuth

$noAuth

No Auth, if set to true, syncFacebookUser will NOT be called

$errors

$errors

Error log

$createUser

$createUser

createUser is true you want the component to attempt to create a CakePHP Auth user account by introspection on the Auth component. If false, you can use $this->hasAccount as a reference to decide what to do with that user. (default true)

$model

$model

name of the authentication model, false by default, set to model alias to init the model.

$plugin

$plugin

name of the plugin containing the authentication model, if any; false by default.

$modelFields

$modelFields

Fields for the model if you want to save the Auth component.

Methods

initialize()

initialize(\Controller $controller,  $settings) : void

Initialize, load the api, decide if we're logged in Sync the connected Facebook user with your application

Parameters

\Controller $controller
$settings

startup()

startup(\Controller $controller) : void

Sync the connected Facebook user with your application.

Attempt to authenticate user using Facebook. Currently the uid is fetched from $this->uid

Parameters

\Controller $controller

registrationData()

registrationData() : \associative

Get registration Data

Returns

\associative —

array of registration data (if there is any)

user()

user( $field)

Read the logged in user

Parameters

$field

role()

role()

Get the current logged in user's developer role for the application (administrators, developers, testers, insight users)

roles()

roles()

Get the developer roles for the application. Returns an object Example return: object(stdClass)[50] public 'data' => array 0 => object(stdClass)[51] public 'app_id' => string '1234567890123' (length=15) public 'user' => string '10000123456789' (length=15) public 'role' => string 'developers' (length=10) 1 => object(stdClass)[52] public 'app_id' => string '1234567890123' (length=15) public 'user' => string '10000987654321' (length=15) public 'role' => string 'administrators' (length=14)

__syncFacebookUser()

__syncFacebookUser() : boolean

Sync the connected Facebook user.

If User is logged in: a. but doesn't have a facebook account associated, try to associate it.

If User is not logged in: b. but have a facebook account associated, try to log the user in. c. and doesn't have a facebook account associated,

  1. try to automatically create an account and associate it (if $this->createUser).
  2. try to log the user in, afterwards.

Returns

boolean —

True if successful, false otherwise.

__runCallback()

__runCallback( $callback,  $passedIn) : mixed

Run the callback if it exists

Parameters

$callback
$passedIn

Returns

mixed —

result of the callback function

__initUserModel()

__initUserModel() : true

Initialize the actual User model object defined by the plugin

Returns

true —

if successful

__error()

__error( $msg) : void

Handle errors.

Parameters

$msg