- {{ '{mfa:account}'|trans({'%idpName%':idpName}) }}
+ {{ '{mfa:account}'|trans({'%idpName%': idpName}) }}
{{ "now"|date("M j, Y") }}
diff --git a/modules/material/themes/material/mfa/send-manager-mfa.twig b/modules/material/themes/material/mfa/send-manager-mfa.twig
index 1e8a423..f23478a 100644
--- a/modules/material/themes/material/mfa/send-manager-mfa.twig
+++ b/modules/material/themes/material/mfa/send-manager-mfa.twig
@@ -29,7 +29,7 @@
- {{ '{mfa:manager_info}'|trans({'%managerEmail%':managerEmail})|raw }}
+ {{ '{mfa:manager_info}'|trans({'%managerEmail%': managerEmail})|raw }}
diff --git a/modules/material/themes/material/profilereview/review.twig b/modules/material/themes/material/profilereview/review.twig
index 1f01494..b28cb38 100644
--- a/modules/material/themes/material/profilereview/review.twig
+++ b/modules/material/themes/material/profilereview/review.twig
@@ -61,14 +61,14 @@
{{ mfa.label }}
{% if mfa.type == 'backupcode' %}
- {{ '{review:remaining}'|trans({'%count%':mfa.data.count}) }}
+ {{ '{review:remaining}'|trans({'%count%': mfa.data.count}) }}
{% endif %}
{% if mfa.last_used_utc is empty %}
{{ '{review:used_never}'|trans }}
{% else %}
- {{ '{review:used}'|trans({'%when%':mfa.last_used_utc}) }}
+ {{ '{review:used}'|trans({'%when%': mfa.last_used_utc}) }}
{% endif %}
From 1251a6b8c5eaddeabb64e05740dfee9488a4346c Mon Sep 17 00:00:00 2001
From: briskt <3172830+briskt@users.noreply.github.com>
Date: Tue, 2 Jul 2024 16:42:45 -0600
Subject: [PATCH 02/12] change twig variables to snake case
---
modules/expirychecker/public/about2expire.php | 9 +++----
modules/expirychecker/public/expired.php | 6 ++---
.../src/Auth/Process/ExpiryDate.php | 6 -----
.../themes/material/default/other_mfas.twig | 4 +--
.../material/default/selectidp-links.twig | 4 +--
.../material/expirychecker/about2expire.twig | 6 ++---
.../material/expirychecker/expired.twig | 2 +-
.../material/mfa/low-on-backup-codes.twig | 2 +-
.../themes/material/mfa/new-backup-codes.twig | 14 +++++-----
.../material/mfa/out-of-backup-codes.twig | 4 +--
.../mfa/prompt-for-mfa-backupcode.twig | 6 ++---
.../material/mfa/prompt-for-mfa-manager.twig | 8 +++---
.../material/mfa/prompt-for-mfa-totp.twig | 8 +++---
.../material/mfa/prompt-for-mfa-webauthn.twig | 18 ++++++-------
.../themes/material/mfa/send-manager-mfa.twig | 6 ++---
.../material/profilereview/nag-for-mfa.twig | 4 +--
.../themes/material/profilereview/review.twig | 12 ++++-----
.../material/silauth/loginuserpass.twig | 26 +++++++++----------
modules/mfa/public/low-on-backup-codes.php | 6 ++---
modules/mfa/public/new-backup-codes.php | 12 ++++-----
modules/mfa/public/out-of-backup-codes.php | 6 ++---
modules/mfa/public/prompt-for-mfa.php | 24 ++++++++---------
modules/mfa/public/send-manager-mfa.php | 9 +++----
modules/profilereview/public/nag.php | 8 +++---
modules/profilereview/public/review.php | 6 ++---
modules/silauth/public/loginuserpass.php | 23 +++++-----------
26 files changed, 108 insertions(+), 131 deletions(-)
diff --git a/modules/expirychecker/public/about2expire.php b/modules/expirychecker/public/about2expire.php
index 05f2de1..7200a7b 100644
--- a/modules/expirychecker/public/about2expire.php
+++ b/modules/expirychecker/public/about2expire.php
@@ -55,12 +55,9 @@
$globalConfig = Configuration::getInstance();
$t = new Template($globalConfig, 'expirychecker:about2expire');
-$t->data['formTarget'] = Module::getModuleURL('expirychecker/about2expire.php');
-$t->data['formData'] = ['StateId' => $stateId];
-$t->data['daysLeft'] = $state['daysLeft'];
-$t->data['dayOrDays'] = (intval($state['daysLeft']) === 1 ? 'day' : 'days');
-$t->data['expiresAtTimestamp'] = $state['expiresAtTimestamp'];
-$t->data['accountName'] = $state['accountName'];
+$t->data['form_target'] = Module::getModuleURL('expirychecker/about2expire.php');
+$t->data['form_data'] = ['StateId' => $stateId];
+$t->data['days_left'] = $state['daysLeft'];
$t->send();
Logger::info('expirychecker - User has been warned that their password will expire soon.');
diff --git a/modules/expirychecker/public/expired.php b/modules/expirychecker/public/expired.php
index 07f8a55..95c42d4 100644
--- a/modules/expirychecker/public/expired.php
+++ b/modules/expirychecker/public/expired.php
@@ -48,10 +48,8 @@
$globalConfig = Configuration::getInstance();
$t = new Template($globalConfig, 'expirychecker:expired');
-$t->data['formTarget'] = Module::getModuleURL('expirychecker/expired.php');
-$t->data['formData'] = ['StateId' => $stateId];
-$t->data['expiresAtTimestamp'] = $state['expiresAtTimestamp'];
-$t->data['accountName'] = $state['accountName'];
+$t->data['form_target'] = Module::getModuleURL('expirychecker/expired.php');
+$t->data['form_data'] = ['StateId' => $stateId];
$t->send();
Logger::info('expirychecker - User has been told that their password has expired.');
diff --git a/modules/expirychecker/src/Auth/Process/ExpiryDate.php b/modules/expirychecker/src/Auth/Process/ExpiryDate.php
index 8503f16..c055a20 100644
--- a/modules/expirychecker/src/Auth/Process/ExpiryDate.php
+++ b/modules/expirychecker/src/Auth/Process/ExpiryDate.php
@@ -242,8 +242,6 @@ public function redirect2PasswordChange(
): void {
$sessionType = 'expirychecker';
/* Save state and redirect. */
- $state['expiresAtTimestamp'] = $expiryTimestamp;
- $state['accountName'] = $accountName;
$id = State::saveState(
$state,
'expirychecker:redirected_to_password_change_url'
@@ -359,8 +357,6 @@ public function redirectToExpiredPage(array &$state, string $accountName, int $e
]));
/* Save state and redirect. */
- $state['expiresAtTimestamp'] = $expiryTimestamp;
- $state['accountName'] = $accountName;
$state['passwordChangeUrl'] = $this->passwordChangeUrl;
$state['originalUrlParam'] = $this->originalUrlParam;
@@ -396,8 +392,6 @@ protected function redirectToWarningPage(array &$state, string $accountName, int
}
/* Save state and redirect. */
- $state['expiresAtTimestamp'] = $expiryTimestamp;
- $state['accountName'] = $accountName;
$state['passwordChangeUrl'] = $this->passwordChangeUrl;
$state['originalUrlParam'] = $this->originalUrlParam;
diff --git a/modules/material/themes/material/default/other_mfas.twig b/modules/material/themes/material/default/other_mfas.twig
index f333cdd..1922a0f 100644
--- a/modules/material/themes/material/default/other_mfas.twig
+++ b/modules/material/themes/material/default/other_mfas.twig
@@ -1,4 +1,4 @@
-{% if otherOptions|length > 0 %}
+{% if other_options|length > 0 %}
{# used type=button to avoid form submission on click since this is just used to display the ul #}
@@ -7,7 +7,7 @@
diff --git a/modules/material/themes/material/mfa/out-of-backup-codes.twig b/modules/material/themes/material/mfa/out-of-backup-codes.twig
index 4eb199e..e4e2cfa 100644
--- a/modules/material/themes/material/mfa/out-of-backup-codes.twig
+++ b/modules/material/themes/material/mfa/out-of-backup-codes.twig
@@ -29,7 +29,7 @@
- {% if hasOtherMfaOptions %}
+ {% if has_other_mfa_options %}
{{ '{mfa:has_options_besides_codes}'|trans }}
{% else %}
{{ '{mfa:has_no_more_options}'|trans }}
@@ -38,7 +38,7 @@
- {% if hasOtherMfaOptions %}
+ {% if has_other_mfa_options %}
{{ '{mfa:button_later}'|trans }}
diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig b/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig
index 8dbf08a..a3c03c7 100644
--- a/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig
+++ b/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig
@@ -42,19 +42,19 @@
- {% if errorMessage is not empty %}
+ {% if error_message is not empty %}
error
- {{ errorMessage|e }}
+ {{ error_message|e }}
{% endif %}
diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig b/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig
index 48d8ef8..68e7fec 100644
--- a/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig
+++ b/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig
@@ -29,7 +29,7 @@