Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -7716,6 +7716,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/tobscure/json-api/.git/hooks',
'/libraries/vendor/tobscure/json-api/.git/branches',
'/libraries/vendor/tobscure/json-api/.git',
// From 4.1.1 to 4.1.2
'/administrator/components/com_users/src/Field/PrimaryauthprovidersField.php',
);

$status['files_checked'] = $files;
Expand Down
9 changes: 0 additions & 9 deletions administrator/components/com_users/forms/user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@
<option value="1">JYES</option>
</field>

<field
name="authProvider"
type="primaryauthproviders"
label="COM_USERS_USER_FIELD_AUTHPROVIDER_LABEL"
description="COM_USERS_USER_FIELD_AUTHPROVIDER_DESC"
>
<option value="">JNONE</option>
</field>

<field
name="id"
type="text"
Expand Down

This file was deleted.

7 changes: 0 additions & 7 deletions administrator/components/com_users/src/Model/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1215,13 +1215,6 @@ public function getOtpConfigEncryptionKey()
public function getTwofactorform($userId = null)
{
$userId = (!empty($userId)) ? $userId : (int) $this->getState('user.id');
$user = $this->getItem($userId);

// Check if core is the auth provider
if ($user->authProvider !== 'Joomla')
{
return [];
}

$otpConfig = $this->getOtpConfig($userId);

Expand Down
2 changes: 0 additions & 2 deletions administrator/language/en-GB/com_users.ini
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,6 @@ COM_USERS_USER_FIELD_PASSWORD1_MESSAGE="The passwords you entered do not match.
COM_USERS_USER_FIELD_PASSWORD2_LABEL="Confirm Password"
COM_USERS_USER_FIELD_REGISTERDATE_LABEL="Registration Date"
COM_USERS_USER_FIELD_REQUIRERESET_LABEL="Require Password Reset"
COM_USERS_USER_FIELD_AUTHPROVIDER_DESC="The authentication method you want to set on the user account."
COM_USERS_USER_FIELD_AUTHPROVIDER_LABEL="Authentication Method"
COM_USERS_USER_FIELD_RESETCOUNT_LABEL="Password Reset Count"
COM_USERS_USER_FIELD_SENDEMAIL_LABEL="Receive System Emails"
COM_USERS_USER_FIELD_TIMEZONE_LABEL="Time Zone"
Expand Down
8 changes: 0 additions & 8 deletions components/com_users/src/Model/ProfileModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,6 @@ public function getTwofactorform($userId = null)
$model = $this->bootComponent('com_users')->getMVCFactory()
->createModel('User', 'Administrator');

$user = $model->getItem($userId);

// Check if core is the auth provider
if ($user->authProvider !== 'Joomla')
{
return array();
}

$otpConfig = $model->getOtpConfig($userId);

PluginHelper::importPlugin('twofactorauth');
Expand Down
20 changes: 0 additions & 20 deletions libraries/src/Authentication/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Event\DispatcherAwareTrait;
use Joomla\Event\DispatcherInterface;
use Joomla\CMS\Authentication\ProviderAwareAuthenticationPluginInterface;

/**
* Authentication class, provides an interface for the Joomla authentication system
Expand Down Expand Up @@ -156,16 +155,6 @@ public function authenticate($credentials, $options = array())
// Create authentication response
$response = new AuthenticationResponse;

// Query existing authProvider constraint
$db = Factory::getContainer()->get('DatabaseDriver');

$pluginConstraint = $db->setQuery(
$db->getQuery(true)
->select($db->quoteName('authProvider'))
->from($db->quoteName('#__users'))
->where($db->quoteName('username') . ' = ' . $db->quote($credentials['username']))
)->loadResult();

/*
* Loop through the plugins and check if the credentials can be used to authenticate
* the user
Expand All @@ -184,15 +173,6 @@ public function authenticate($credentials, $options = array())
continue;
}

// Check auth provider constraint
if ($pluginConstraint
&& $plugin instanceof ProviderAwareAuthenticationPluginInterface
&& $plugin::isPrimaryProvider()
&& $plugin::getProviderName() !== $pluginConstraint)
{
continue;
}

// Try to authenticate
$plugin->onUserAuthenticate($credentials, $options, $response);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

/**
* Interface class defining the necessary methods for an authentication plugin to be provider aware
* Please note: might be deprecated with Joomla 4.2
*
* @since 3.10.7
*/
Expand Down
37 changes: 0 additions & 37 deletions libraries/src/Table/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,41 +565,4 @@ public function setLastVisit($timeStamp = null, $userId = null)

return true;
}

/**
* Updates auth provider of a user
*
* @param string $authProvider The auth provider name
* @param integer $userId The user id (optional).
*
* @return boolean False if an error occurs
*
* @since 3.10.7
*/
public function setAuthProvider($authProvider, $userId = null)
{
// Check for User ID
if (is_null($userId))
{
if (isset($this))
{
$userId = $this->id;
}
else
{
jexit('No userid in setAuthProvider');
}
}

// Update the database row for the user.
$db = $this->_db;
$query = $db->getQuery(true)
->update($db->quoteName($this->_tbl))
->set($db->quoteName('authProvider') . '=' . $db->quote($authProvider))
->where($db->quoteName('id') . '=' . (int) $userId);
$db->setQuery($query);
$db->execute();

return true;
}
}
19 changes: 0 additions & 19 deletions libraries/src/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,25 +524,6 @@ public function getTimezone()
return new \DateTimeZone($timezone);
}

/**
* Pass through method to the table for setting the auth provider in login contexts.
* Works around issues with hardcoded permission checks in save() associated to super admins
*
* @param string $authProvider The auth plugin name
*
* @return boolean True on success.
*
* @since 3.10.7
*/
public function setAuthProvider($authProvider)
{
// Create the user table object
$table = $this->getTable();
$table->load($this->id);

return $table->setAuthProvider($authProvider);
}

/**
* Method to get the user parameters
*
Expand Down
30 changes: 2 additions & 28 deletions plugins/authentication/cookie/cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
use Joomla\CMS\User\User;
use Joomla\CMS\User\UserHelper;

use Joomla\CMS\Authentication\ProviderAwareAuthenticationPluginInterface;

/**
* Joomla Authentication plugin
*
* @since 3.2
* @note Code based on http://jaspan.com/improved_persistent_login_cookie_best_practice
* and http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/
*/
class PlgAuthenticationCookie extends CMSPlugin implements ProviderAwareAuthenticationPluginInterface
class PlgAuthenticationCookie extends CMSPlugin
{
/**
* Application object
Expand Down Expand Up @@ -109,7 +107,7 @@ public function onUserAuthenticate($credentials, $options, &$response)
return false;
}

$response->type = self::getProviderName();
$response->type = 'Cookie';

// Filter series since we're going to use it in the query
$filter = new InputFilter;
Expand Down Expand Up @@ -448,28 +446,4 @@ public function onUserAfterLogout($options)

return true;
}

/**
* Remember Me shall work with any other auth plugin
*
* @return false
*
* @since 3.10.7
*/
public static function isPrimaryProvider()
{
return false;
}

/**
* Return provider name
*
* @return string
*
* @since 3.10.7
*/
public static function getProviderName()
{
return 'Cookie';
}
}
30 changes: 2 additions & 28 deletions plugins/authentication/joomla/joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
use Joomla\CMS\User\User;
use Joomla\CMS\User\UserHelper;

use Joomla\CMS\Authentication\ProviderAwareAuthenticationPluginInterface;

/**
* Joomla Authentication plugin
*
* @since 1.5
*/
class PlgAuthenticationJoomla extends CMSPlugin implements ProviderAwareAuthenticationPluginInterface
class PlgAuthenticationJoomla extends CMSPlugin
{
/**
* Application object
Expand Down Expand Up @@ -55,7 +53,7 @@ class PlgAuthenticationJoomla extends CMSPlugin implements ProviderAwareAuthenti
*/
public function onUserAuthenticate($credentials, $options, &$response)
{
$response->type = self::getProviderName();
$response->type = 'Joomla';

// Joomla does not like blank passwords
if (empty($credentials['password']))
Expand Down Expand Up @@ -239,28 +237,4 @@ public function onUserAuthenticate($credentials, $options, &$response)
}
}
}

/**
* Acts as primary auth provider
*
* @return true
*
* @since 3.10.7
*/
public static function isPrimaryProvider()
{
return true;
}

/**
* Return provider name
*
* @return string
*
* @since 3.10.7
*/
public static function getProviderName()
{
return 'Joomla';
}
}
Loading