diff --git a/root/etc/e-smith/db/configuration/migrate/90MigrateLemonLDAP b/root/etc/e-smith/db/configuration/migrate/90MigrateLemonLDAP new file mode 100644 index 0000000..b1e36df --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/90MigrateLemonLDAP @@ -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'); +} + +} + diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/05LemonLDAPHandler b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/05LemonLDAPHandler index fba7928..5e0e1e4 100644 --- a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/05LemonLDAPHandler +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/05LemonLDAPHandler @@ -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"; +} }