* @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\User\User; use Webauthn\PublicKeyCredentialSource; /** * Passwordless Login management interface * * Generic data * * @var FileLayout $this The Joomla layout renderer * @var array $displayData The data in array format. DO NOT USE. * * Layout specific data * * @var User $user The Joomla user whose passwordless login we are managing * @var bool $allow_add Are we allowed to add passwordless login methods * @var array $credentials The already stored credentials for the user * @var string $error Any error messages * @var array $knownAuthenticators Known authenticator metadata * @var boolean $attestationSupport Is authenticator attestation supported in the plugin? */ // Extract the data. Do not remove until the unset() line. try { $app = Factory::getApplication(); $loggedInUser = $app->getIdentity(); $app->getDocument()->getWebAssetManager() ->registerAndUseStyle('plg_system_webauthn.backend', 'plg_system_webauthn/backend.css'); } catch (Exception $e) { $loggedInUser = new User(); } $defaultDisplayData = [ 'user' => $loggedInUser, 'allow_add' => false, 'credentials' => [], 'error' => '', 'knownAuthenticators' => [], 'attestationSupport' => true, ]; extract(array_merge($defaultDisplayData, $displayData)); if ($displayData['allow_add'] === false) { $error = Text::_('PLG_SYSTEM_WEBAUTHN_CANNOT_ADD_FOR_A_USER'); $allow_add = false; } // Ensure the GMP or BCmath extension is loaded in PHP - as this is required by third party library if ($allow_add && function_exists('gmp_intval') === false && function_exists('bccomp') === false) { $error = Text::_('PLG_SYSTEM_WEBAUTHN_REQUIRES_GMP'); $allow_add = false; } Text::script('JGLOBAL_CONFIRM_DELETE'); HTMLHelper::_('bootstrap.tooltip', '.plg_system_webauth-has-tooltip'); ?>
getAaguid() : ''; $authMetadata = $knownAuthenticators[$aaguid->toString()] ?? $knownAuthenticators['']; ?>
,
colspan="2" scope="col">
<?php echo $authMetadata->description ?>