Skip to content

Commit 92cad14

Browse files
authored
[4.x] MFA Backup Codes [a11y] [UI] (#43450)
* fix * Update components/com_users/tmpl/methods/list.php Co-authored-by: Quy <[email protected]> ---------
1 parent 8ea9c26 commit 92cad14

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

administrator/components/com_users/tmpl/methods/list.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@ class="img-fluid"
6969
<?php foreach ($method['active'] as $record) : ?>
7070
<div class="com-users-methods-list-method-record d-flex flex-row flex-wrap justify-content-start border-top py-2">
7171
<div class="com-users-methods-list-method-record-info flex-grow-1 d-flex flex-column align-items-start gap-1">
72-
<?php if ($methodName === 'backupcodes') : ?>
73-
<?php if ($canAddEdit) : ?>
74-
<div class="alert alert-info mt-1 w-100">
75-
<?php echo Text::sprintf('COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD', Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id)) ?>
76-
</div>
77-
<?php endif ?>
72+
<?php if ($methodName === 'backupcodes' && $canAddEdit) : ?>
73+
<div class="alert alert-info mt-1 w-100">
74+
<?php echo Text::sprintf('COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD', Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id), 'text-decoration-underline') ?>
75+
</div>
7876
<?php else : ?>
7977
<h4 class="com-users-methods-list-method-record-title-container mb-1 fs-3">
8078
<?php if ($record->default) : ?>

administrator/language/en-GB/com_users.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ COM_USERS_MFA_ACTIVE="Uses Multi-factor Authentication"
260260
COM_USERS_MFA_ADD_AUTHENTICATOR_OF_TYPE="Add a new %s"
261261
COM_USERS_MFA_ADD_PAGE_HEAD="Add a Multi-factor Authentication Method"
262262
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT="Backup Codes let you log into the site if your regular Multi-factor Authentication method does not work or you no longer have access to it. Each code can be used <em>only once</em>."
263-
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%s\">Print these codes</a> and keep them in your wallet."
263+
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%1s\" class=\"%2s\">Print these codes</a> and keep them in your wallet."
264264
COM_USERS_MFA_BACKUPCODES_RESET="Regenerate Backup Codes"
265265
COM_USERS_MFA_BACKUPCODES_RESET_INFO="Use the \"Regenerate Backup Codes\" button on the toolbar to generate a new set of Backup Codes. We recommend that you do this if you think your Backup Codes are compromised, e.g. someone got hold of a printout with them, or if you are running low on available Backup Codes."
266266
COM_USERS_MFA_EDIT_FIELD_DEFAULT="Make this the default Multi-factor Authentication method"

components/com_users/tmpl/methods/list.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@ class="img-fluid"
6969
<?php foreach ($method['active'] as $record) : ?>
7070
<div class="com-users-methods-list-method-record d-flex flex-row flex-wrap justify-content-start border-top py-2">
7171
<div class="com-users-methods-list-method-record-info flex-grow-1 d-flex flex-column align-items-start gap-1">
72-
<?php if ($methodName === 'backupcodes') : ?>
73-
<?php if ($canAddEdit) : ?>
74-
<div class="alert alert-info mt-1 w-100">
75-
<?php echo Text::sprintf('COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD', Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id)) ?>
76-
</div>
77-
<?php endif ?>
72+
<?php if ($methodName === 'backupcodes' && $canAddEdit) : ?>
73+
<div class="alert alert-info mt-1 w-100">
74+
<?php echo Text::sprintf('COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD', Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id), 'text-decoration-underline') ?>
75+
</div>
7876
<?php else : ?>
7977
<h3 class="com-users-methods-list-method-record-title-container mb-1 fs-5">
8078
<?php if ($record->default) : ?>

language/en-GB/com_users.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ COM_USERS_MAIL_SEND_FAILURE_SUBJECT="Error sending email"
4545
COM_USERS_MFA_ADD_AUTHENTICATOR_OF_TYPE="Add a new %s"
4646
COM_USERS_MFA_ADD_PAGE_HEAD="Add a Multi-factor Authentication Method"
4747
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT="Backup Codes let you log into the site if your regular Multi-factor Authentication method does not work or you no longer have access to it. Each code can be used <em>only once</em>."
48-
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%s\">Print these codes</a> and keep them in your wallet."
48+
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%1s\" class=\"%2s\">Print these codes</a> and keep them in your wallet."
4949
COM_USERS_MFA_BACKUPCODES_RESET="Regenerate Backup Codes"
5050
COM_USERS_MFA_BACKUPCODES_RESET_INFO="Use the button below to generate a new set of Backup Codes. We recommend that you do this if you think your Backup Codes are compromised, e.g. someone got hold of a printout with them, or if you are running low on available Backup Codes."
5151
COM_USERS_MFA_EDIT_FIELD_DEFAULT="Make this the default Multi-factor Authentication method"

0 commit comments

Comments
 (0)