From b557e15afc84716a9cb6b4211ebec9621c04c969 Mon Sep 17 00:00:00 2001 From: Rich Evans <32852052+revansx@users.noreply.github.com> Date: Thu, 6 Jun 2019 19:23:37 -0400 Subject: [PATCH 1/3] Update download.php 1 of 3 fixes for https://github.com/enterprisemediawiki/meza/issues/1186 --- src/roles/htdocs/files/BackupDownload/download.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/roles/htdocs/files/BackupDownload/download.php b/src/roles/htdocs/files/BackupDownload/download.php index 332da47c5..ceccc31e3 100644 --- a/src/roles/htdocs/files/BackupDownload/download.php +++ b/src/roles/htdocs/files/BackupDownload/download.php @@ -79,13 +79,12 @@ // if there's a SAML config file, we need to authenticate with SAML, like, now. -if ( is_file( $m_deploy.'/SAMLConfig.php' ) ) { - require_once $m_htdocs.'/NonMediaWikiSimpleSamlAuth.php'; -} -else { +{% if saml_public is defined %} + require_once __DIR__ . '/NonMediaWikiSimpleSamlAuth.php'; +{% else %} header('HTTP/1.0 403 Forbidden'); echo "Backup downloading is not permitted without Single Sign On"; -} +{% endif %} $as = new SimpleSAML_Auth_Simple('default-sp'); $as->requireAuth(); From d14ceec377469d5d6fa47d81a5fa7ac97ca038ca Mon Sep 17 00:00:00 2001 From: Rich Evans <32852052+revansx@users.noreply.github.com> Date: Thu, 6 Jun 2019 19:27:24 -0400 Subject: [PATCH 2/3] Update index.php 2 of 3 fixes for https://github.com/enterprisemediawiki/meza/issues/1186 --- src/roles/htdocs/files/BackupDownload/index.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/roles/htdocs/files/BackupDownload/index.php b/src/roles/htdocs/files/BackupDownload/index.php index 8b1105603..3bdbddc92 100644 --- a/src/roles/htdocs/files/BackupDownload/index.php +++ b/src/roles/htdocs/files/BackupDownload/index.php @@ -17,13 +17,12 @@ require_once '/opt/.deploy-meza/config.php'; // if there's a SAML config file, we need to authenticate with SAML, like, now. -if ( is_file( $m_deploy.'/SAMLConfig.php' ) ) { - require_once $m_htdocs.'/NonMediaWikiSimpleSamlAuth.php'; -} -else { +{% if saml_public is defined %} + require_once __DIR__ . '/NonMediaWikiSimpleSamlAuth.php'; +{% else %} header('HTTP/1.0 403 Forbidden'); echo "Backup downloading is not permitted without Single Sign On"; -} +{% endif %} $as = new SimpleSAML_Auth_Simple( 'default-sp' ); $as->requireAuth(); From 95e6752688504ac8d4dd993f330b10dacf89b5e7 Mon Sep 17 00:00:00 2001 From: Rich Evans <32852052+revansx@users.noreply.github.com> Date: Thu, 6 Jun 2019 19:29:49 -0400 Subject: [PATCH 3/3] Update index.php.j2 3rd fix of 3 for https://github.com/enterprisemediawiki/meza/issues/1186 --- src/roles/htdocs/templates/index.php.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/roles/htdocs/templates/index.php.j2 b/src/roles/htdocs/templates/index.php.j2 index f726120fe..6202bb359 100644 --- a/src/roles/htdocs/templates/index.php.j2 +++ b/src/roles/htdocs/templates/index.php.j2 @@ -1,8 +1,8 @@