Allow getAttr to return DN
Specify "DN" as attribute name to return, but will only work if not present in ldap.Entry.Attributes Use when full DN is stored in groupSearch's userAttr
This commit is contained in:
@@ -47,6 +47,9 @@ import (
|
||||
// baseDN: cn=groups,dc=example,dc=com
|
||||
// filter: "(objectClass=group)"
|
||||
// userAttr: uid
|
||||
// # Use if full DN is needed and not available as any other attribute
|
||||
// # Will only work if "DN" attribute does not exist in the record
|
||||
// # userAttr: DN
|
||||
// groupAttr: member
|
||||
// nameAttr: name
|
||||
//
|
||||
@@ -285,6 +288,9 @@ func getAttr(e ldap.Entry, name string) string {
|
||||
}
|
||||
return a.Values[0]
|
||||
}
|
||||
if name == "DN" {
|
||||
return e.DN
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user