Skip to content

Commit

Permalink
[4.x] MFA Backup Codes [a11y] [UI] (#43450)
Browse files Browse the repository at this point in the history
* fix

* Update components/com_users/tmpl/methods/list.php

Co-authored-by: Quy <[email protected]>

---------
  • Loading branch information
brianteeman authored May 14, 2024
1 parent 8ea9c26 commit 92cad14
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
10 changes: 4 additions & 6 deletions administrator/components/com_users/tmpl/methods/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ class="img-fluid"
<?php foreach ($method['active'] as $record) : ?>
<div class="com-users-methods-list-method-record d-flex flex-row flex-wrap justify-content-start border-top py-2">
<div class="com-users-methods-list-method-record-info flex-grow-1 d-flex flex-column align-items-start gap-1">
<?php if ($methodName === 'backupcodes') : ?>
<?php if ($canAddEdit) : ?>
<div class="alert alert-info mt-1 w-100">
<?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)) ?>
</div>
<?php endif ?>
<?php if ($methodName === 'backupcodes' && $canAddEdit) : ?>
<div class="alert alert-info mt-1 w-100">
<?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') ?>
</div>
<?php else : ?>
<h4 class="com-users-methods-list-method-record-title-container mb-1 fs-3">
<?php if ($record->default) : ?>
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_users.ini
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ COM_USERS_MFA_ACTIVE="Uses Multi-factor Authentication"
COM_USERS_MFA_ADD_AUTHENTICATOR_OF_TYPE="Add a new %s"
COM_USERS_MFA_ADD_PAGE_HEAD="Add a Multi-factor Authentication Method"
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>."
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%s\">Print these codes</a> and keep them in your wallet."
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%1s\" class=\"%2s\">Print these codes</a> and keep them in your wallet."
COM_USERS_MFA_BACKUPCODES_RESET="Regenerate Backup Codes"
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."
COM_USERS_MFA_EDIT_FIELD_DEFAULT="Make this the default Multi-factor Authentication method"
Expand Down
10 changes: 4 additions & 6 deletions components/com_users/tmpl/methods/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ class="img-fluid"
<?php foreach ($method['active'] as $record) : ?>
<div class="com-users-methods-list-method-record d-flex flex-row flex-wrap justify-content-start border-top py-2">
<div class="com-users-methods-list-method-record-info flex-grow-1 d-flex flex-column align-items-start gap-1">
<?php if ($methodName === 'backupcodes') : ?>
<?php if ($canAddEdit) : ?>
<div class="alert alert-info mt-1 w-100">
<?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)) ?>
</div>
<?php endif ?>
<?php if ($methodName === 'backupcodes' && $canAddEdit) : ?>
<div class="alert alert-info mt-1 w-100">
<?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') ?>
</div>
<?php else : ?>
<h3 class="com-users-methods-list-method-record-title-container mb-1 fs-5">
<?php if ($record->default) : ?>
Expand Down
2 changes: 1 addition & 1 deletion language/en-GB/com_users.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ COM_USERS_MAIL_SEND_FAILURE_SUBJECT="Error sending email"
COM_USERS_MFA_ADD_AUTHENTICATOR_OF_TYPE="Add a new %s"
COM_USERS_MFA_ADD_PAGE_HEAD="Add a Multi-factor Authentication Method"
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>."
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%s\">Print these codes</a> and keep them in your wallet."
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%1s\" class=\"%2s\">Print these codes</a> and keep them in your wallet."
COM_USERS_MFA_BACKUPCODES_RESET="Regenerate Backup Codes"
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."
COM_USERS_MFA_EDIT_FIELD_DEFAULT="Make this the default Multi-factor Authentication method"
Expand Down

0 comments on commit 92cad14

Please sign in to comment.