]> _ Git - fluidbook-hosting.git/commitdiff
wip #5074 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Mar 2022 15:11:31 +0000 (17:11 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Mar 2022 15:11:31 +0000 (17:11 +0200)
VacheronSSO/_sso.php

index 44770eb87cf78424dd15a60f5e619429682fb44e..9deec82b0ffbabb676394bdd420ec69040d67a9c 100644 (file)
@@ -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);
     }
 }