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] Fixes #1055 and changes location.reload to window = xy in footer script

03031516
AndrĂ© Peters <[email protected]> 8 years ago
data/web/inc/ajax/destroy_tfa_auth.php |  6 ++++++
 data/web/inc/footer.inc.php            | 13 ++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 data/web/inc/ajax/destroy_tfa_auth.php

Diff

diff --git a/data/web/inc/ajax/destroy_tfa_auth.php b/data/web/inc/ajax/destroy_tfa_auth.php
new file mode 100644
index 00000000..72c7f1e3
--- /dev/null
+++ b/data/web/inc/ajax/destroy_tfa_auth.php
@@ -0,0 +1,6 @@
+<?php
+session_start();
+unset($_SESSION['pending_mailcow_cc_username']);
+unset($_SESSION['pending_mailcow_cc_role']);
+unset($_SESSION['pending_tfa_method']);
+?>
diff --git a/data/web/inc/footer.inc.php b/data/web/inc/footer.inc.php
index 3c92c28e..a4974604 100644
--- a/data/web/inc/footer.inc.php
+++ b/data/web/inc/footer.inc.php
@@ -79,6 +79,17 @@ $(document).ready(function() {
         });
       }
   });
+  $('#ConfirmTFAModal').on('hidden.bs.modal', function(){
+      $.ajax({
+        type: "GET",
+        cache: false,
+        dataType: 'script',
+        url: '/inc/ajax/destroy_tfa_auth.php',
+        complete: function(data){
+          window.location = window.location.href.split("#")[0];
+        }
+      });
+  });
   <?php endif; ?>
 
   // Set TFA modals
@@ -205,7 +216,7 @@ $(document).ready(function() {
           $('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
           $('#statusTriggerRestartContainer2').append(data);
           $('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
-          location.reload();
+          window.location = window.location.href.split("#")[0];
         }
       });
     });