1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-12 10:45:14 +02:00

[Web] Allow logout with broken session

[Web] Try to set aria hidden to false when a modal opens
This commit is contained in:
andryyy 2019-03-25 12:33:58 +01:00
parent 6a13609bf0
commit 3c4c760e29
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 22 additions and 18 deletions

View File

@ -26,6 +26,10 @@ $(window).load(function() {
$(".overlay").hide(); $(".overlay").hide();
}); });
$(document).ready(function() { $(document).ready(function() {
$(document).on('shown.bs.modal', function(e) {
modal_id = $(e.relatedTarget).data('target');
$(modal_id).attr("aria-hidden","false");
});
// TFA, CSRF, Alerts in footer.inc.php // TFA, CSRF, Alerts in footer.inc.php
// Other general functions in mailcow.js // Other general functions in mailcow.js
<?php <?php

View File

@ -75,6 +75,24 @@ if (!empty($_SERVER['HTTP_X_API_KEY'])) {
// Update session cookie // Update session cookie
// setcookie(session_name() ,session_id(), time() + $SESSION_LIFETIME); // setcookie(session_name() ,session_id(), time() + $SESSION_LIFETIME);
// Handle logouts
if (isset($_POST["logout"])) {
if (isset($_SESSION["dual-login"])) {
$_SESSION["mailcow_cc_username"] = $_SESSION["dual-login"]["username"];
$_SESSION["mailcow_cc_role"] = $_SESSION["dual-login"]["role"];
unset($_SESSION["dual-login"]);
header("Location: /mailbox");
exit();
}
else {
session_regenerate_id(true);
session_unset();
session_destroy();
session_write_close();
header("Location: /");
}
}
// Check session // Check session
function session_check() { function session_check() {
if (isset($_SESSION['mailcow_cc_api']) && $_SESSION['mailcow_cc_api'] === true) { if (isset($_SESSION['mailcow_cc_api']) && $_SESSION['mailcow_cc_api'] === true) {
@ -106,21 +124,3 @@ if (isset($_SESSION['mailcow_cc_role']) && session_check() === false) {
$_POST = array(); $_POST = array();
$_FILES = array(); $_FILES = array();
} }
// Handle logouts
if (isset($_POST["logout"])) {
if (isset($_SESSION["dual-login"])) {
$_SESSION["mailcow_cc_username"] = $_SESSION["dual-login"]["username"];
$_SESSION["mailcow_cc_role"] = $_SESSION["dual-login"]["role"];
unset($_SESSION["dual-login"]);
header("Location: /mailbox");
exit();
}
else {
session_regenerate_id(true);
session_unset();
session_destroy();
session_write_close();
header("Location: /");
}
}