Utilisation de la prop Authentication pour la protection des domaines par LL::NG

This commit is contained in:
Daniel Berteaud 2012-09-04 12:35:54 +02:00
parent 9b7e219094
commit aa73eed866
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,14 @@
{
use esmith::DomainsDB;
my $d = esmith::DomainsDB->open() or die "Couldn't open DomainsDB\n";
foreach my $domain ($d->domains){
my $llng = $domain->prop('LemonLDAP') || '';
next unless $llng eq 'enabled';
$domain->set_prop('Authentication', 'LemonLDAP');
$domain->delete_prop('LemonLDAP');
}
}

View File

@ -1,6 +1,8 @@
{
if (($domain->prop('LemonLDAP') || 'disabled') eq 'enabled'){
my $auth = $domain->prop('Authentication') || 'none';
if ($auth eq 'LemonLDAP'){
$OUT .= " # This virtualhost is configured to be protected by LemonLDAP NG\n" .
" PerlHeaderParserHandler My::Package\n" .
" ErrorDocument 403 https://auth.$DomainName/?lmError=403\n" .
@ -9,5 +11,9 @@ if (($domain->prop('LemonLDAP') || 'disabled') eq 'enabled'){
$OUT .= " PerlOutputFilterHandler Lemonldap::NG::Handler::Menu\n";
}
}
elsif ($auth eq 'LemonLDAPBasic'){
$OUT .= " # This virtualhost is configured to be protected by LemonLDAP NG (basic auth)\n" .
" PerlHeaderParserHandler Lemonldap::NG::Handler::AuthBasic\n";
}
}