This plugin adds the ability to login/register users automatically using a facebook application, extending Rainlab.User plugin.
Requirements
- Rainlab.User plugin
October CMS User Facebook
Rainlab.User extension to login and register with Facebook.
If you are not familiar and for better understanding of whole functionality, please read the documentation of Rainlab.User too.
Installation
1.1. Open the update panel and search for eBussola.UserFacebook plugin.
OR
1.2. Copy all files to plugins/ebussola/userfacebook and execute composer install
to install the dependencies libraries.
- Configure the App ID and App Secret on the settings page. (Settings -> User Facebook Settings)
- Add the Facebook Session component on your page or layout. NOTE: This component extends User's Session, so you don't need to use both.
- Add
{% component 'facebookSession::fb-sdk' %}
to include facebook's SDK. - Add
{% component 'facebookSession::login-button' %}
anywhere on your page/layout.
Of course all snippets can be customized, they are used just to faster the development and to be used as a guide.
Example
{# Loads the facebook SDK #} {% component 'facebookSession::fb-sdk' %} {% if user %} Logged in as {{ user.name }} <a href="#" data-request="facebookSession::onLogout">Logout</a> {% else %} {% component 'facebookSession::login-button' %} {% endif %}
FacebookSession Component API
onLoginWithFacebook
Redirect
You can use use_redirect (boolean) property passed by POST to enable or disable the redirect.
Use redirect_signup to specify the address to redirect the user when he is signing up. Or redirect_login when he is loggin in.
-
This plugin has not been reviewed yet.
-
1.4.0 |
Added 2 options to component "redirect signup" and "redirect login" May 11, 2015 |
---|---|
1.3.0 |
Added permissions to facebook token settings. Bugfix of User's security redirection. Apr 07, 2015 |
1.2.0 |
Added database settings support Mar 18, 2015 |
1.1.0 |
Refactored code to be more simple. Added locale support. Added installation guide. Mar 15, 2015 |
1.0.1 |
First version of UserFacebook Mar 15, 2015 |