[Web] Allow logout with broken session
[Web] Try to set aria hidden to false when a modal opensmaster
parent
6a13609bf0
commit
3c4c760e29
|
@ -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
|
||||||
|
|
|
@ -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: /");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue