[Web] Important: Do not allow API actions with r/o session key, THANKS TO Samuel Oosterholt
parent
a885dab0d3
commit
99ab945ae2
|
@ -304,5 +304,12 @@ $(document).ready(function() {
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
|
if (isset($_SESSION['mailcow_cc_api'])) {
|
||||||
|
session_regenerate_id(true);
|
||||||
|
session_unset();
|
||||||
|
session_destroy();
|
||||||
|
session_write_close();
|
||||||
|
header("Location: /");
|
||||||
|
}
|
||||||
$stmt = null;
|
$stmt = null;
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
|
|
|
@ -93,7 +93,7 @@ if (isset($_SESSION['mailcow_cc_role']) && ($_SESSION['mailcow_cc_role'] == "adm
|
||||||
fido2(array("action" => "unset_fido2_key", "post_data" => $_POST));
|
fido2(array("action" => "unset_fido2_key", "post_data" => $_POST));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admin") {
|
if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admin" && !isset($_SESSION['mailcow_cc_api'])) {
|
||||||
// TODO: Move file upload to API?
|
// TODO: Move file upload to API?
|
||||||
if (isset($_POST["submit_main_logo"])) {
|
if (isset($_POST["submit_main_logo"])) {
|
||||||
if ($_FILES['main_logo']['error'] == 0) {
|
if ($_FILES['main_logo']['error'] == 0) {
|
||||||
|
|
Loading…
Reference in New Issue