diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-21.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-21.sql
new file mode 100644
index 0000000000000..066a594341e12
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-21.sql
@@ -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);
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-21.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-21.sql
new file mode 100644
index 0000000000000..a32d0a3263917
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-21.sql
@@ -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);
diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-21.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-21.sql
new file mode 100644
index 0000000000000..d4e9675081502
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-21.sql
@@ -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;
\ No newline at end of file
diff --git a/administrator/components/com_users/helpers/users.php b/administrator/components/com_users/helpers/users.php
index c3a9770ca39c7..0928de477cb25 100644
--- a/administrator/components/com_users/helpers/users.php
+++ b/administrator/components/com_users/helpers/users.php
@@ -174,8 +174,8 @@ public static function getRangeOptions()
*/
public static function getTwoFactorMethods()
{
- FOFPlatform::getInstance()->importPlugin('twofactorauth');
- $identities = FOFPlatform::getInstance()->runPlugins('onUserTwofactorIdentify', array());
+ JPluginHelper::importPlugin('twofactorauth');
+ $identities = JEventDispatcher::getInstance()->trigger('onUserTwofactorIdentify', array());
$options = array(
JHtml::_('select.option', 'none', JText::_('JGLOBAL_OTPMETHOD_NONE'), 'value', 'text'),
diff --git a/administrator/language/en-GB/en-GB.plg_authentication_facebook.ini b/administrator/language/en-GB/en-GB.plg_authentication_facebook.ini
new file mode 100644
index 0000000000000..3537b2fdf9797
--- /dev/null
+++ b/administrator/language/en-GB/en-GB.plg_authentication_facebook.ini
@@ -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). You need to create a Facebook app for your site. Facebook login only works in the front-end of your site. Warning!Facebook login bypasses Two Factor Authentication. Warning! You must have at least one authentication plugin enabled or you will lose all access to your site."
+
+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."
diff --git a/administrator/language/en-GB/en-GB.plg_authentication_facebook.sys.ini b/administrator/language/en-GB/en-GB.plg_authentication_facebook.sys.ini
new file mode 100644
index 0000000000000..e4066d3827b8c
--- /dev/null
+++ b/administrator/language/en-GB/en-GB.plg_authentication_facebook.sys.ini
@@ -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). You need to create a Facebook app for your site. Warning!Facebook login bypasses Two Factor Authentication. Warning! You must have at least one authentication plugin enabled or you will lose all access to your site."
diff --git a/administrator/manifests/packages/pkg_weblinks.xml b/administrator/manifests/packages/pkg_weblinks.xml
deleted file mode 100644
index f8699dcaaecd2..0000000000000
--- a/administrator/manifests/packages/pkg_weblinks.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
- pkg_weblinks
- weblinks
- December 2012
- Joomla! Project
- (C) 2005 - 2016 Open Source Matters. All rights reserved.
- admin@joomla.org
- www.joomla.org
- Joomla! Project
- admin@joomla.org
- www.joomla.org
- 3.4.1
- GNU General Public License version 2 or later; see LICENSE.txt
- PKG_WEBLINKS_XML_DESCRIPTION
-
-
- com_weblinks.zip
- mod_weblinks.zip
- plg_finder_weblinks.zip
- plg_search_weblinks.zip
-
-
- en-GB/en-GB.pkg_weblinks.sys.ini
-
-
-
- https://raw.githubusercontent.com/joomla-extensions/weblinks/master/manifest.xml
-
-
diff --git a/administrator/modules/mod_login/mod_login.php b/administrator/modules/mod_login/mod_login.php
index a972336b4ff38..74dd4632f29e4 100644
--- a/administrator/modules/mod_login/mod_login.php
+++ b/administrator/modules/mod_login/mod_login.php
@@ -14,6 +14,7 @@
$langs = ModLoginHelper::getLanguageList();
$twofactormethods = JAuthenticationHelper::getTwoFactorMethods();
+$extraFields = JAuthenticationHelper::getUserLoginFormFields();
$return = ModLoginHelper::getReturnUri();
require JModuleHelper::getLayoutPath('mod_login', $params->get('layout', 'default'));
diff --git a/administrator/modules/mod_login/tmpl/default.php b/administrator/modules/mod_login/tmpl/default.php
index 7384869c9d5a4..8cd0a8ea410cd 100644
--- a/administrator/modules/mod_login/tmpl/default.php
+++ b/administrator/modules/mod_login/tmpl/default.php
@@ -70,6 +70,32 @@
+ getType() != 'field') continue;
+ ?>
+
+
+
diff --git a/components/com_users/models/registration.php b/components/com_users/models/registration.php
index 64c3d5d897b2d..ad2a1b4ce291e 100644
--- a/components/com_users/models/registration.php
+++ b/components/com_users/models/registration.php
@@ -372,18 +372,21 @@ protected function populateState()
/**
* Method to save the form data.
*
- * @param array $temp The form data.
+ * @param array $temp The form data.
+ * @param bool $verified Is this user account / email address pre-verified (e.g. through a social network integration)?
*
* @return mixed The user id on success, false on failure.
*
* @since 1.6
*/
- public function register($temp)
+ public function register($temp, $verified = false)
{
$params = JComponentHelper::getParams('com_users');
// Initialise the table with JUser.
$user = new JUser;
+
+ // Get the default data from the site's setup
$data = (array) $this->getData();
// Merge in the registration data.
@@ -398,6 +401,12 @@ public function register($temp)
$useractivation = $params->get('useractivation');
$sendpassword = $params->get('sendpassword', 1);
+ // If the email / user account is pre-verified there's no need to send an activation email.
+ if ($verified)
+ {
+ $useractivation = 0;
+ }
+
// Check if the user needs to activate their account.
if (($useractivation == 1) || ($useractivation == 2))
{
diff --git a/components/com_users/views/login/tmpl/default_login.php b/components/com_users/views/login/tmpl/default_login.php
index 7f6c7ccda1bd8..8f4752aefd3c0 100644
--- a/components/com_users/views/login/tmpl/default_login.php
+++ b/components/com_users/views/login/tmpl/default_login.php
@@ -11,6 +11,9 @@
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
+
+/** @var UsersViewLogin $this */
+
?>