63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
{
|
|
my $access = $limesurvey{'access'} || 'private';
|
|
my $allow = ($access eq 'public') ? 'all' : "$localAccess $externalSSLAccess";
|
|
my $alias = (($limesurvey{'AliasOnPrimary'} || 'enabled') ne 'enabled') ?
|
|
'' : '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" . (($ver =~ m/^9/) ? " AuthBasicProvider external\n":'') .
|
|
" Require valid-user\n" : '';
|
|
|
|
if ($limesurvey{'status'} eq 'enabled'){
|
|
|
|
$OUT .=<<"END";
|
|
|
|
# LimeSurvey Configuration
|
|
$alias
|
|
|
|
<Directory /usr/share/limesurvey>
|
|
Options None
|
|
Options +FollowSymLinks
|
|
AllowOverride All
|
|
SSLRequireSSL on
|
|
AddType application/x-httpd-php .php
|
|
php_admin_value open_basedir /usr/share/limesurvey:/var/lib/limesurvey
|
|
php_admin_flag file_uploads On
|
|
php_admin_flag magic_quotes Off
|
|
php_admin_flag magic_quotes_gpc Off
|
|
php_admin_value upload_max_filesize 10M
|
|
php_admin_value post_max_size 12M
|
|
php_admin_value memory_limit 100M
|
|
php_admin_value max_execution_time 120
|
|
php_admin_value upload_tmp_dir /var/lib/limesurvey/tmp
|
|
php_admin_value session.save_path /var/lib/limesurvey/sessions
|
|
order deny,allow
|
|
deny from all
|
|
allow from $allow
|
|
Satisfy all
|
|
</Directory>
|
|
END
|
|
|
|
if ($alias ne ''){
|
|
$OUT .=<<"END";
|
|
<LocationMatch "^/limesurvey/(index\.php/)?admin">
|
|
SSLRequireSSL on
|
|
$auth
|
|
</LocationMatch>
|
|
END
|
|
|
|
}
|
|
$OUT .=<<'END';
|
|
<DirectoryMatch "/usr/share/limesurvey/(framework|console|installer/sql|locale|application/(logs|config)|docs)">
|
|
Deny from all
|
|
</DirectoryMatch>
|
|
|
|
END
|
|
|
|
}
|
|
else{
|
|
$OUT .= "# LimeSurvey is disabled\n";
|
|
}
|
|
}
|