- md5
- a79bf7dd5390c601b0126d4dd5a146ef
- sha1
- 74a28aa8d45acdd4a62f0eff6bb1996f5c6469c4
- sha256
- ad218c9d4c46a5ddfa69daa6a55cb9471f82c99de261e4a6b1653fb59dc6e9ea
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright Copyright (C) 2022 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Users\Administrator\Field;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Plugin\PluginHelper;
defined('_JEXEC') or die;
/**
* Auth provider field.
*
* @since 3.10.7
*/
class PrimaryauthprovidersField extends ListField
{
/**
* The form field type.
*
* @var string
* @since 3.10.7
*/
protected $type = 'Primaryauthproviders';
/**
* Method to get the field options.
*
* @return array The field option objects
*
* @since 3.10.7
*/
protected function getOptions()
{
// Build the filter options.
$options = array();
PluginHelper::importPlugin('authentication');
$plugins = PluginHelper::getPlugin('authentication');
foreach ($plugins as $plugin)
{
$className = 'plg' . $plugin->type . $plugin->name;
if (!class_exists($className))
{
continue;
}
if (!is_subclass_of(
$className,
"Joomla\CMS\Authentication\ProviderAwareAuthenticationPluginInterface"
)
|| !$className::isPrimaryProvider())
{
continue;
}
$options[] = (object) ['value' => $className::getProviderName(), 'text' => $className::getProviderName()];
}
// Merge any additional options in the XML definition.
return array_merge(parent::getOptions(), $options);
}
}
The same content is in 2 releases, Joomla 4.1.1 to 4.2.0-alpha1. See them all, or every version of this file.