diff --git a/ActiveDirectoryProvider/ActiveDirectoryProvider.cs b/ActiveDirectoryProvider/ActiveDirectoryProvider.cs
index cd8bca2..f6a7c1c 100644
--- a/ActiveDirectoryProvider/ActiveDirectoryProvider.cs
+++ b/ActiveDirectoryProvider/ActiveDirectoryProvider.cs
@@ -45,6 +45,10 @@ namespace ScrewTurn.Wiki.Plugins.ActiveDirectory {
"
" +
"- AutomaticMail=example.com
" +
"
" +
+ "Case insensitive login (optional):" +
+ "" +
+ "- CaseInsensitive
" +
+ "
" +
"Comments start with a semicolon \";\".";
private IHostV30 m_Host;
@@ -58,6 +62,7 @@ namespace ScrewTurn.Wiki.Plugins.ActiveDirectory {
public string Username;
public string Password;
public string AutomaticMail;
+ public bool CaseInsensitive;
private Dictionary GroupMap = new Dictionary(StringComparer.InvariantCultureIgnoreCase);
@@ -412,6 +417,17 @@ namespace ScrewTurn.Wiki.Plugins.ActiveDirectory {
if(user != null)
return user;
+
+ if(m_Config.CaseInsensitive) {
+ UserInfo[] all = StorageProvider.GetUsers();
+
+ int userIndex = Array.BinarySearch(all, new UserInfo(username, null, null, true, DateTime.MinValue, null), new UsernameComparer());
+
+ if(userIndex >= 0)
+ return all[userIndex];
+ }
+
+
// Active Directory Attributes
//
// http://msdn.microsoft.com/en-us/library/ms683980(VS.85).aspx
@@ -743,7 +759,7 @@ namespace ScrewTurn.Wiki.Plugins.ActiveDirectory {
///
/// The information
public ComponentInformation Information {
- get { return new ComponentInformation("Active Directory Provider", "Threeplicate Srl", "3.0.2.518", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/ADProv/ADProv.txt"); }
+ get { return new ComponentInformation("Active Directory Provider", "Threeplicate Srl", "3.0.2.534", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/ADProv/ADProv.txt"); }
}
@@ -853,6 +869,11 @@ namespace ScrewTurn.Wiki.Plugins.ActiveDirectory {
string[] configEntry = remainingConfigLine.Split(new[] { '=' }, 2);
+ if(configEntry.Length == 1 && configEntry[0].ToLowerInvariant() == "caseinsensitive") {
+ newConfig.CaseInsensitive = true;
+ continue;
+ }
+
if(configEntry.Length != 2) {
LogEntry(LogEntryType.Error,
"Config lines must be in the format \"Key=Value\". " +