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] 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 %}
- {% if hasOtherMfaOptions %} + {% if has_other_mfa_options %} {{ '{mfa:has_options_besides_codes}'|trans }} {% else %} {{ '{mfa:has_no_more_options}'|trans }} @@ -38,7 +38,7 @@
error
- {{ '{mfa:manager_sent}'|trans({'%managerEmail%': managerEmail}) }} + {{ '{mfa:manager_sent}'|trans({'%managerEmail%': manager_email}) }}
error
error