NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Web] fixed totp var in twig

Signed-off-by: Kristian Feldsam <[email protected]>

97410040
Kristian Feldsam <[email protected]> 4 years, 9 months ago
data/web/inc/footer.inc.php           | 1 +
 data/web/templates/modals/footer.twig | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)

Diff

diff --git a/data/web/inc/footer.inc.php b/data/web/inc/footer.inc.php
index 4d0a18b4..9a438666 100644
--- a/data/web/inc/footer.inc.php
+++ b/data/web/inc/footer.inc.php
@@ -35,6 +35,7 @@ $globalVariables = [
   'pagination_size' => $PAGINATION_SIZE,
   'log_pagination_size' => $LOG_PAGINATION_SIZE,
   'alerts' => $alerts,
+  'totp_secret' => $tfa->createSecret(),
 ];
 
 foreach ($globalVariables as $globalVariableName => $globalVariableValue) {
diff --git a/data/web/templates/modals/footer.twig b/data/web/templates/modals/footer.twig
index 9b6be6e1..d1e794b8 100644
--- a/data/web/templates/modals/footer.twig
+++ b/data/web/templates/modals/footer.twig
@@ -89,17 +89,14 @@
             <input type="password" class="form-control" name="confirm_password" placeholder="{{ lang.user.password_now }}" autocomplete="off" required>
           </div>
           <hr>
-          <?php
-          $totp_secret = $tfa->createSecret();
-          ?>
-          <input type="hidden" value="<?=$totp_secret;?>" name="totp_secret">
+          <input type="hidden" value="{{ totp_secret }}" name="totp_secret">
           <input type="hidden" name="tfa_method" value="totp">
           <ol>
             <li>
               <p>{{ lang.tfa.scan_qr_code }}</p>
-              <img id="tfa-qr-img" data-totp-secret="<?=$totp_secret;?>" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=">
+              <img id="tfa-qr-img" data-totp-secret="{{ totp_secret }}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=">
               <p class="help-block">{{ lang.tfa.enter_qr_code }}:<br />
-                <code><?=$totp_secret;?></code>
+                <code>{{ totp_secret }}</code>
               </p>
             </li>
             <li>