From f2f002faea230a7165d46786a8b8cc01ad05ea6b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 31 Mar 2022 17:11:31 +0200 Subject: [PATCH] wip #5074 @0.5 --- VacheronSSO/_sso.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/VacheronSSO/_sso.php b/VacheronSSO/_sso.php index 44770eb..9deec82 100644 --- a/VacheronSSO/_sso.php +++ b/VacheronSSO/_sso.php @@ -26,7 +26,10 @@ if ($_SERVER['HTTP_HOST'] === 'cabinotiers.vacheron-constantin.com') { $metadata = 'https://login.microsoftonline.com/10c68b76-5682-4564-a75d-9ef796a2f318/federationmetadata/2007-06/federationmetadata.xml?appid=48b8e0f9-effd-41e9-b35e-6511459dee30'; } -session_start(); +if (session_status() !== PHP_SESSION_ACTIVE) { + session_start(); +} + $needsAuth = !(isset($_SESSION['samlOK']) && $_SESSION['samlOK']); if (isset($_GET['return'])) { @@ -109,6 +112,7 @@ if ($needsAuth) { try { $auth = new Auth($samlsettings); + } catch (Exception $e) { http_response_code(500); print_r($e); @@ -133,7 +137,7 @@ if ($needsAuth) { file_put_contents($logdir . 'err.' . $t . '.log', print_r($errors, true) . "\n\n--\n\n" . print_r($auth->getLastErrorReason(), true) . "\n\n--\n\n" . print_r($auth->getLastErrorException(), true)); } } else { - $auth->login(); + $auth->login(null, [], true); } } -- 2.39.5