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] 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();