]> _ Git - fluidbook-hosting.git/commitdiff
wip #5074 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Mar 2022 09:29:22 +0000 (10:29 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Mar 2022 09:29:22 +0000 (10:29 +0100)
.gitignore
VacheronSSO/.htaccess
VacheronSSO/_secure.php

index 279140780293e3ab6fc82f5cbf98221487a02ec9..ef9cd22651c9adb0e49bedb0c9946183d7ad688c 100644 (file)
@@ -1,4 +1,5 @@
 /LVMH-SSO/vendor/
 /LVMH-SSO/d/
 /LVMH-SSO/mf/
-/LVMH-SSO/index.html
\ No newline at end of file
+/LVMH-SSO/index.html
+/VacheronSSO/vendor/
\ No newline at end of file
index 0c1e92a43c30caf322bd1306e87a56539e0a10f8..e021dea82a161797d74160fa6b96a88e75e50e95 100644 (file)
@@ -1,4 +1,6 @@
 RewriteEngine on
-RewriteBase /test/Vacheron-Constantin/
+RewriteBase /
+RewriteCond %{HTTP_HOST} hosting.fluidbook.com
+RewriteRule ^(.*)$ https://cabinotiers.vacheron-constantin.com/$1 [R=301,L]
 RewriteRule ^_secure.php$ - [L]
 RewriteRule ^.*$ _secure.php [L,QSA]
\ No newline at end of file
index 8253dff5ac8577634630bff99315fd3fca73a3a8..0f1816a4c0ed0d45159a4826070681b7a902a88c 100644 (file)
@@ -2,14 +2,21 @@
 
 use GuzzleHttp\Client;
 
+$logdir = __DIR__ . '/log/';
+
+if (!file_exists($logdir)) {
+    mkdir($logdir, 0777, true);
+}
+
 $t = md5(rand(0, 10000000));
 if (isset($_POST) && count($_POST)) {
-    file_put_contents(__DIR__ . '/log/log.' . $t . '.log', print_r($_POST, true));
+    file_put_contents($logdir . 'log.' . $t . '.log', print_r($_POST, true));
 }
 
-$basedir = '/test/Vacheron-Constantin/';
-$base = 'https://hosting.fluidbook.com' . $basedir;
-$metadata = 'https://login.microsoftonline.com/10c68b76-5682-4564-a75d-9ef796a2f318/federationmetadata/2007-06/federationmetadata.xml?appid=48b8e0f9-effd-41e9-b35e-6511459dee30';
+$basedir = '/';
+$base = 'https://cabinotiers.vacheron-constantin.com' . $basedir;
+//$metadata = 'https://login.microsoftonline.com/10c68b76-5682-4564-a75d-9ef796a2f318/federationmetadata/2007-06/federationmetadata.xml?appid=48b8e0f9-effd-41e9-b35e-6511459dee30';
+$metadata = 'https://login.microsoftonline.com/94b3f1b2-8b3a-49e3-ba33-8b8fb6d18361/federationmetadata/2007-06/federationmetadata.xml?appid=fd419245-db40-4031-856e-de24fbe41d13';
 
 $forbiddenext = ['php', 'htaccess', '_metadata'];
 foreach ($forbiddenext as $ext) {
@@ -121,8 +128,8 @@ if ($needsAuth) {
             $_SESSION['samlUserdata'] = $auth->getAttributes();
             $_SESSION['samlOK'] = true;
             session_write_close();
-            file_put_contents(__DIR__ . '/log/ok.' . $t . '.log', print_r($_SESSION, true));
-            file_put_contents(__DIR__ . '/log/xml.' . $t . '.log', $auth->getLastResponseXML());
+            file_put_contents($logdir.'ok.' . $t . '.log', print_r($_SESSION, true));
+            file_put_contents($logdir. 'xml.' . $t . '.log', $auth->getLastResponseXML());
 
             if ($_POST['RelayState'] !== $base) {
                 header('Location: ' . $_POST['RelayState'], true);
@@ -130,7 +137,7 @@ if ($needsAuth) {
             }
 
         } else {
-            file_put_contents(__DIR__ . '/log/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));
+            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));
         }
     }