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

tags/smeserver-lemonldap-ng-0.2.19-1
Daniel Berteaud 12 years ago
parent 9b7e219094
commit aa73eed866
  1. 14
      root/etc/e-smith/db/configuration/migrate/90MigrateLemonLDAP
  2. 8
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/05LemonLDAPHandler

@ -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…
Cancel
Save