Hi,
We have had CruiseControl in our build environment for 8 months now but we had to take a fork of the code to repair a bug that I would like to see going back into the main code stream so that we can upgrade as we are a few versions behind.
If you define multiple LDAP converters then the foreach loop iterates through each of these, which is fine, but if you get a match on the first converter and not on one of following converters then the email address is set back to null on the code.
If your login is for a domain that is not the same domain as the CI server then the username is not "USERNAME" it is "DOMAIN\USERNAME", so in the LDAP converter this must be considered and stripped if it's on there.
For our CI system the solution was very few lines of code:
Firstly EmailLDAPConverter.cs:
public string Convert(string username)
{
if(username.Contains("\\"))
{
//then its a DOMAIN\USERNAME
var tmpUsername = username.Split(new[] {'\\'});
username = tmpUsername[1];
if(tmpUsername[0].ToLower() != domainName.ToLower())
{
return null;
}
}
For EmailMessage.cs:
if (user == null && emailPublisher.Converters.Length > 0)
{
string email = username;
foreach (IEmailConverter converter in emailPublisher.Converters)
{
email = converter.Convert(username);
if(email != null)
{
break;
}
}
if (email != null)
{
user = new EmailUser(username, group, email);
}
}
As you can see, the changes made were very simple, the LDAP converter did a string check and strip, and the EmailMessage had a break line added.
I hope someone can help us get this into the main stream.
Thanks