Skip to content

Commit

Permalink
[4.0] Webauthn gmp warning (joomla#29731)
Browse files Browse the repository at this point in the history
Add warning if GMP not loaded for Webauthn
  • Loading branch information
PhilETaylor authored and sakiss committed Oct 16, 2020
1 parent d05fcc8 commit 8816ca3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions administrator/language/en-GB/plg_system_webauthn.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ PLG_SYSTEM_WEBAUTHN_MANAGE_HEADER_ACTIONS_LABEL="Actions"
PLG_SYSTEM_WEBAUTHN_MANAGE_HEADER_NOMETHODS_LABEL="No authenticators have been set up yet."
PLG_SYSTEM_WEBAUTHN_MSG_DELETED="The authenticator has been removed."
PLG_SYSTEM_WEBAUTHN_MSG_SAVED_LABEL="The label has been saved."
PLG_SYSTEM_WEBAUTHN_REQUIRES_GMP="The PHP Extension GMP is required to be loaded in order to add authenticators."

7 changes: 7 additions & 0 deletions layouts/plugins/system/webauthn/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
];
extract(array_merge($defaultDisplayData, $displayData));

// Ensure the GMP Extension is loaded in PHP - as this is required by third party library
if (false === function_exists('gmp_intval'))
{
$error = Text::_('PLG_SYSTEM_WEBAUTHN_REQUIRES_GMP');
$allow_add = false;
}

/**
* Why not push these configuration variables directly to JavaScript?
*
Expand Down

0 comments on commit 8816ca3

Please sign in to comment.