From 7ead4f8589b4ed74be7cf03ccf24e2a4927a256b Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 9 Jan 2017 14:49:48 +0100 Subject: [PATCH] Update Lemonldap::NG handler to use the Authentication prop of domains --- .../httpd/conf/httpd.conf/VirtualHosts/05LemonLDAPHandler | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/05LemonLDAPHandler b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/05LemonLDAPHandler index 165d1da..dba812d 100644 --- a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/05LemonLDAPHandler +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/05LemonLDAPHandler @@ -1,10 +1,21 @@ { -if (($domain->prop('LemonLDAP') || 'disabled') eq 'enabled'){ +my $auth = $domain->prop('Authentication') || 'none'; + +if (($modSSL{'TCPPort'} || '443') eq $port){ + if ($auth eq 'LemonLDAP'){ $OUT .= " # This virtualhost is configured to be protected by LemonLDAP NG\n" . " PerlHeaderParserHandler Lemonldap::NG::Handler\n" . " ErrorDocument 403 https://auth.$DomainName/?lmError=403\n" . " ErrorDocument 500 https://auth.$DomainName/?lmError=500\n"; + if (($domain->prop('LemonLDAPMenu') || '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::Specific::AuthBasic\n"; + } } }