Utilisation de la prop Authentication pour la protection des domaines par LL::NG
This commit is contained in:
parent
9b7e219094
commit
aa73eed866
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue