From c17894643765b80c5f0e4b04591b621ecfdd6f8c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 13 Aug 2014 10:09:26 +0200 Subject: [PATCH] Make it works with both SME8 and SME9 And fix HTTP auth when not using LemonLDAP::NG --- .../e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey | 12 ++++++------ .../etc/httpd/conf/httpd.conf/VirtualHosts/60LimeSurveySSL | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey index 8bd636b..f3d4b1c 100644 --- a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey @@ -1,12 +1,12 @@ { my $access = $limesurvey{'access'} || 'private'; -my $allow = ($access eq 'public')?'all':"$localAccess $externalSSLAccess"; - +my $allow = ($access eq 'public') ? 'all' : "$localAccess $externalSSLAccess"; my $alias = (($limesurvey{'AliasOnPrimary'} || 'enabled') ne 'enabled') ? - '':'Alias /limesurvey /usr/share/limesurvey'; + '' : 'Alias /limesurvey /usr/share/limesurvey'; +my $ver = $sysconfig{'ReleaseVersion'} || '8.1'; my $auth = (($limesurvey{'Authentication'} || 'http') eq 'http') ? "AuthName \"LimeSurvey\"\n" . " AuthType Basic\n" . - " AuthExternal pwauth\n" . + " AuthExternal pwauth\n" . (($ver =~ m/^9/) ? " AuthBasicProvider external\n":'') . " Require valid-user\n" : ''; if ($limesurvey{'status'} eq 'enabled'){ @@ -37,10 +37,10 @@ $alias allow from $allow Satisfy all - + SSLRequireSSL on $auth - + Deny from all diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/60LimeSurveySSL b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/60LimeSurveySSL index 8df56bb..5276a95 100644 --- a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/60LimeSurveySSL +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/60LimeSurveySSL @@ -7,6 +7,6 @@ if (($port ne $sslport) && ($status eq 'enabled') && ($alias eq 'enabled')){ ## Redirect Web Address to Secure Address $OUT .= " RewriteRule ^/limesurvey/admin(/.*|\$) https://%{HTTP_HOST}/limesurvey/admin\$1 \[L,R\]\n"; - + $OUT .= " RewriteRule ^/limesurvey/index.php/admin(/.*|\$) https://%{HTTP_HOST}/limesurvey/index.php/admin\$1 \[L,R\]\n"; } }