[Web] allow mbox sso_token login for mailcow and sogo

This commit is contained in:
FreddleSpl0it
2023-06-16 08:53:25 +02:00
parent 06cce79806
commit eb33166f3e
6 changed files with 122 additions and 18 deletions

View File

@@ -1,13 +1,20 @@
<?php
// SSO Domain Admin
if (!empty($_GET['sso_token'])) {
// SSO Domain Admin
$username = domain_admin_sso('check', $_GET['sso_token']);
if ($username !== false) {
$_SESSION['mailcow_cc_username'] = $username;
$_SESSION['mailcow_cc_role'] = 'domainadmin';
header('Location: /mailbox');
}
// SSO Mailbox User
$username = mailbox_sso('check', $_GET['sso_token']);
if ($username !== false) {
$_SESSION['mailcow_cc_username'] = $username;
$_SESSION['mailcow_cc_role'] = 'user';
header('Location: /mailbox');
}
}
if (isset($_POST["verify_tfa_login"])) {