{

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::ApacheMP2\n" .
            "    ErrorDocument 403 https://auth.$DomainName/?lmError=403\n" .
            "    ErrorDocument 500 https://auth.$DomainName/?lmError=500\n" .
            "    ErrorDocument 404 http://auth.example.com/lmerror/404\n" .
            "    ErrorDocument 502 http://auth.example.com/lmerror/502\n" .
            "    ErrorDocument 503 http://auth.example.com/lmerror/503\n";
    if (($domain->prop('LemonLDAPMenu') || 'disabled') eq 'enabled'){
        $OUT .= "    PerlOutputFilterHandler Lemonldap::NG::Handler::ApacheMP2::Menu->run\n";
    }
  }
  elsif ($auth eq 'LemonLDAPBasic'){
    $OUT .= "    # This virtualhost is configured to be protected by LemonLDAP NG (basic auth)\n" .
            "    PerlHeaderParserHandler Lemonldap::NG::Handler::ApacheMP2\n" .
            "    PerlSetVar VHOSTTYPE AuthBasic\n";
  }
}

}
