[Web] Better mobileconfig handling

This commit is contained in:
andryyy
2019-12-15 13:02:38 +01:00
parent 8c3ab0371a
commit 61f776173f
7 changed files with 56 additions and 9 deletions

View File

@@ -5,8 +5,11 @@ if (empty($mailcow_hostname)) {
exit();
}
if (!isset($_SESSION['mailcow_cc_role']) || $_SESSION['mailcow_cc_role'] != 'user') {
header("Location: index.php");
die("This page is only available to logged-in users, not admins.");
session_destroy();
// probably better than appending the whole current http query string
$append_get = (isset($_GET['only_email'])) ? '&only_email' : '';
header('Location: index.php?mobileconfig' . $append_get);
die();
}
error_reporting(0);