Skip to content

Commit

Permalink
+ fixed server path filter
Browse files Browse the repository at this point in the history
  • Loading branch information
c3rebro committed Jan 2, 2019
1 parent eb783ee commit 7d1fee7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,19 @@ public static int Main(string[] args){
else {
try {
//extract server and dn from ldap path attribute
string dn = _arguments[0].Replace("LDAP://",string.Empty).Remove(0,_arguments[0].Replace("LDAP://",string.Empty).IndexOf('/') +1);
string server = _arguments[0].Replace("LDAP://",string.Empty).Remove(_arguments[0].Replace("LDAP://",string.Empty).IndexOf('/'), dn.Length + 1);
string dn = _arguments[0].ToUpper().Replace("LDAP://",string.Empty)
.Replace("LDAPS://",string.Empty)
.Remove(0,_arguments[0].ToUpper()
.Replace("LDAP://",string.Empty).Replace("LDAPS://",string.Empty)
.IndexOf('/') +1)
.ToLower();

string server = _arguments[0].ToUpper().Replace("LDAP://",string.Empty)
.Replace("LDAPS://",string.Empty)
.Remove(_arguments[0].ToUpper()
.Replace("LDAP://",string.Empty).Replace("LDAPS://",string.Empty)
.IndexOf('/'), dn.Length + 1)
.ToLower();

LdapDirectoryIdentifier ldapDir = new LdapDirectoryIdentifier(server);

Expand Down

0 comments on commit 7d1fee7

Please sign in to comment.