-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facebook Login integration for Joomla! #11778
Changes from all commits
4076746
c8c04cc
6fabdb8
afcb7da
72317e1
34e01ac
d058996
f95c248
6fb4a3e
01b8dcf
1cc71aa
5f0eb28
0c997bd
1ce97cf
a5249ad
74f572a
558e9a2
51c7bd2
6c34940
3011b01
dd2edcd
bb96d4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES | ||
(458, 'plg_authentication_facebook', 'plugin', 'facebook', 'authentication', 0, 0, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 3, 0); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES | ||
(458, 'plg_authentication_facebook', 'plugin', 'facebook', 'authentication', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 3, 0); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SET IDENTITY_INSERT #__extensions ON; | ||
|
||
INSERT INTO #__extensions ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) | ||
SELECT 458, 'plg_authentication_facebook', 'plugin', 'facebook', 'authentication', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 3, 0; | ||
|
||
SET IDENTITY_INSERT #__extensions OFF; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
; Note 2: Do NOT alpha-sort the language keys. It makes translation far harder because it deprives the translator | ||
; of the string's context! | ||
|
||
PLG_AUTHENTICATION_FACEBOOK="Authentication - Facebook" | ||
PLG_AUTHENTICATION_FACEBOOK_XML_DESCRIPTION="Handles User Authentication with a Facebook account (Requires cURL).<br />You need to <a href='https://developers.facebook.com/apps'>create a Facebook app</a> for your site. Facebook login only works in the front-end of your site.<br /><strong>Warning!</strong>Facebook login bypasses Two Factor Authentication.<br /><strong> Warning! You must have at least one authentication plugin enabled or you will lose all access to your site.</strong>" | ||
|
||
PLG_AUTHENTICATION_FACEBOOK_FIELD_APPID_LABEL="Facebook Application ID" | ||
PLG_AUTHENTICATION_FACEBOOK_FIELD_APPID_DESC="Enter the App ID for your custom Facebook application here. This is required to enable social login with Facebook. You can create a Facebook app at https://developers.facebook.com/apps." | ||
PLG_AUTHENTICATION_FACEBOOK_FIELD_APPSECRET_LABEL="Facebook Application Secret" | ||
PLG_AUTHENTICATION_FACEBOOK_FIELD_APPSECRET_DESC="Enter the App Secret for your custom Facebook application here. This is required to enable social login with Facebook. You can create a Facebook app at https://developers.facebook.com/apps." | ||
PLG_AUTHENTICATION_FACEBOOK_FIELD_CREATENEW_LABEL="Create new user accounts?" | ||
PLG_AUTHENTICATION_FACEBOOK_FIELD_CREATENEW_DESC="Creates a new Joomla! user when a user tries to log in via Facebook but there is no Joomla! user account associated with that e-mail or Facebook User ID. If user registration is disabled no account will be created and an error will be raised. The Joomla! user has a username derived from the Facebook login, the same email address as the Facebook account and a long, random password (which the user can change once they have logged in). Set this to No to prevent creation of user accounts through Facebook login." | ||
|
||
PLG_AUTHENTICATION_FACEBOOK_BTN_LABEL="Facebook Login" | ||
|
||
PLG_AUTHENTICATION_FACEBOOK_ERROR_NOT_LOGGED_IN_FB="You are not logged into Facebook or you didn't grant permissions for our site to log you in through Facebook" | ||
PLG_AUTHENTICATION_FACEBOOK_ERROR_ACCOUNT_DISABLED_OR_NOT_ACTIVATED="Your account on our site is disabled or not activated." | ||
PLG_AUTHENTICATION_FACEBOOK_ERROR_LOCAL_NOT_FOUND="You do not have an account on our site that corresponds to this Facebook account." | ||
PLG_AUTHENTICATION_FACEBOOK_ERROR_LOCAL_USERNAME_CONFLICT="An account with the same username as your Facebook account already exists on our site. Please create a new user account on our site and then link your Facebook account to it." | ||
PLG_AUTHENTICATION_FACEBOOK_ERROR_CANNOT_CREATE="Could not create a new user on our site: %s" | ||
|
||
PLG_AUTHENTICATION_FACEBOOK_NOTICE_USERACTIVATE="Your email address needs to be verified before logging in to our site. An email has been sent to you with instructions. After following these instructions please come back here and retry logging in to our site using Facebook." | ||
PLG_AUTHENTICATION_FACEBOOK_NOTICE_ADMINACTIVATE="Your account needs to be reviewed by an administrator. When the review process is complete you will receive a confirmation email. After receiving that email please come back here and retry logging in to our site using Facebook." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_AUTHENTICATION_FACEBOOK="Authentication - Facebook" | ||
PLG_AUTHENTICATION_FACEBOOK_XML_DESCRIPTION="Handles User Authentication with a Facebook account (Requires cURL).<br />You need to <a href='https://developers.facebook.com/apps'>create a Facebook app</a> for your site.<br /><strong>Warning!</strong>Facebook login bypasses Two Factor Authentication.<br /><strong> Warning! You must have at least one authentication plugin enabled or you will lose all access to your site.</strong>" |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,31 @@ | |
*/ | ||
class UsersViewLogin extends JViewLegacy | ||
{ | ||
/** | ||
* @var JForm | ||
*/ | ||
protected $form; | ||
|
||
/** | ||
* Additional login form fields | ||
* | ||
* @var JAuthenticationFieldInterface[] | ||
* | ||
* @since 3.7 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you were not to know but a new feature is if you just put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since @wilsonge is not in favor of a 3.8 release and this feature needs to be merged before refactoring login code into 4.0 it's essentially 3.7 or back to the drawing board and hope to get it merged in 2-3 years. |
||
*/ | ||
protected $extraFields; | ||
|
||
/** | ||
* Users component parameters | ||
* | ||
* @var \Joomla\Registry\Registry | ||
*/ | ||
protected $params; | ||
|
||
protected $state; | ||
|
||
protected $tfa; | ||
|
||
protected $user; | ||
|
||
/** | ||
|
@@ -57,9 +76,20 @@ public function display($tpl = null) | |
$this->setLayout($active->query['layout']); | ||
} | ||
|
||
$tfa = JAuthenticationHelper::getTwoFactorMethods(); | ||
$tfa = JAuthenticationHelper::getTwoFactorMethods(); | ||
$this->tfa = is_array($tfa) && count($tfa) > 1; | ||
|
||
if ($this->params->get('login_redirect_url')) | ||
{ | ||
$returnUrl = $this->params->get('login_redirect_url', $this->form->getValue('return')); | ||
} | ||
else | ||
{ | ||
$returnUrl = $this->params->get('login_redirect_menuitem', $this->form->getValue('return')); | ||
} | ||
|
||
$this->extraFields = JAuthenticationHelper::getUserLoginFormFields($returnUrl); | ||
|
||
// Escape strings for HTML output | ||
$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'), ENT_COMPAT, 'UTF-8'); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roflmao
Thats something the PLT will have to decide on