diff --git a/src/Application/Controller/d3_account_webauthn.php b/src/Application/Controller/d3_account_webauthn.php index 33cf940..1820dc1 100755 --- a/src/Application/Controller/d3_account_webauthn.php +++ b/src/Application/Controller/d3_account_webauthn.php @@ -45,6 +45,8 @@ class d3_account_webauthn extends AccountController $this->addTplParam('user', $this->getUser()); + $this->addTplParam('readonly', (bool) !(oxNew(Webauthn::class)->isAvailable())); + return $sRet; } diff --git a/src/Application/Model/Webauthn.php b/src/Application/Model/Webauthn.php index cf7a846..34f691f 100644 --- a/src/Application/Model/Webauthn.php +++ b/src/Application/Model/Webauthn.php @@ -34,7 +34,10 @@ class Webauthn return true; } - Registry::getUtilsView()->addErrorToDisplay('WebAuthn is available on secure connections only.'); + Registry::getUtilsView()->addErrorToDisplay( + Registry::getLang()->translateString('D3_WEBAUTHN_ERR_UNSECURECONNECTION', null, true) + ); + return false; } diff --git a/src/Application/views/admin/de/d3webauthn_lang.php b/src/Application/views/admin/de/d3webauthn_lang.php index 7f145a2..658ad39 100755 --- a/src/Application/views/admin/de/d3webauthn_lang.php +++ b/src/Application/views/admin/de/d3webauthn_lang.php @@ -31,6 +31,8 @@ $aLang = [ 'D3_WEBAUTHN_ADDKEY' => 'Sicherheitsschlüssel hinzufügen', 'D3_WEBAUTHN_REGISTEREDKEYS' => 'registrierte Schlüssel', + + 'D3_WEBAUTHN_ERR_UNSECURECONNECTION' => 'Die Verwendung von Sicherheitsschlüsseln ist nur bei gesicherten Verbindungen (https) möglich.', /* 'D3_TOTP_QRCODE' => 'QR-Code', 'D3_TOTP_QRCODE_HELP' => 'Scannen Sie diesen QR-Code mit Ihrer Authentisierungs-App, um dieses Benutzerkonto dort zu hinterlegen.', diff --git a/src/Application/views/admin/en/d3webauthn_lang.php b/src/Application/views/admin/en/d3webauthn_lang.php index b89818d..70e724b 100755 --- a/src/Application/views/admin/en/d3webauthn_lang.php +++ b/src/Application/views/admin/en/d3webauthn_lang.php @@ -31,6 +31,8 @@ $aLang = [ 'D3_WEBAUTHN_ADDKEY' => 'add security key', 'D3_WEBAUTHN_REGISTEREDKEYS' => 'registered keys', + + 'D3_WEBAUTHN_ERR_UNSECURECONNECTION' => 'The use of security keys is only possible with secured connections (https).', /* 'D3_TOTP_QRCODE' => 'QR-Code', 'D3_TOTP_QRCODE_HELP' => 'Scannen Sie diesen QR-Code mit Ihrer Authentisierungs-App, um dieses Benutzerkonto dort zu hinterlegen.', diff --git a/src/Application/views/tpl/d3_account_webauthn.tpl b/src/Application/views/tpl/d3_account_webauthn.tpl index 01f0af7..ac43812 100755 --- a/src/Application/views/tpl/d3_account_webauthn.tpl +++ b/src/Application/views/tpl/d3_account_webauthn.tpl @@ -11,6 +11,12 @@ [{/capture}] [{oxscript add=$smarty.capture.javascripts}] + [{if $readonly}] + [{assign var="readonly" value="readonly disabled"}] + [{else}] + [{assign var="readonly" value=""}] + [{/if}] +