add basic auth
This commit is contained in:
parent
3503370aed
commit
3de2f3a54a
|
@ -1,10 +1,31 @@
|
|||
{
|
||||
my $access = $opensondage{'access'} || 'private';
|
||||
my $allow = ($access eq 'public')?'all':"$localAccess $externalSSLAccess";
|
||||
|
||||
my $auth = $opensondage{'Authentication'}' || 'http';
|
||||
my $alias = (($opensondage{'AliasOnPrimary'} || 'enabled') eq 'enabled') ?
|
||||
'Alias /opensondage /usr/share/opensondage' : '';
|
||||
|
||||
my $authuser = '';
|
||||
my $authadmin = '';
|
||||
if ($auth eq 'http'){
|
||||
$authuser =<<'EOF';
|
||||
<FilesMatch "^($|(index|adminstubs|info_sondage)\.php)">
|
||||
SSLRequireSSL on
|
||||
AuthName "OpenSondage"
|
||||
AuthType Basic
|
||||
AuthExternal pwauth
|
||||
Require valid-user
|
||||
</FilesMatch>
|
||||
EOF
|
||||
$authadmin =<<'EOF';
|
||||
<Directory /usr/share/opensondage/admin>
|
||||
SSLRequireSSL on
|
||||
AuthName "OpenSondage Admin"
|
||||
AuthType Basic
|
||||
AuthExternal pwauth
|
||||
Require user admin
|
||||
</Directory>
|
||||
EOF
|
||||
}
|
||||
if ($opensondage{'status'} eq 'enabled'){
|
||||
|
||||
$OUT .=<<"END"
|
||||
|
@ -27,7 +48,9 @@ $alias
|
|||
<Files ~ "\.(txt|TXT|sql|SQL)$">
|
||||
Deny from all
|
||||
</Files>
|
||||
$authuser
|
||||
</Directory>
|
||||
$authadmin
|
||||
<Directory ~ "/usr/share/opensondage/(errors|adodb|iCalcreator|locale|php2pdf|scripts)">
|
||||
Deny from all
|
||||
</Directory>
|
||||
|
|
Loading…
Reference in New Issue