mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-26 15:25:43 +03:00
fix simple LDAP userDN
This commit is contained in:
parent
d600530c20
commit
2bc3e83e1c
1 changed files with 2 additions and 3 deletions
|
@ -82,8 +82,8 @@ func (ls Ldapsource) FindUserDN(name string) (string, bool) {
|
||||||
func (ls Ldapsource) SearchEntry(name, passwd string, directBind bool) (string, string, string, bool, bool) {
|
func (ls Ldapsource) SearchEntry(name, passwd string, directBind bool) (string, string, string, bool, bool) {
|
||||||
var userDN string
|
var userDN string
|
||||||
if directBind {
|
if directBind {
|
||||||
log.Trace("LDAP will bind directly via UserDN template: %s", ls.UserDN)
|
log.Trace("LDAP will bind directly via UserDN: %s", ls.UserDN)
|
||||||
userDN = fmt.Sprintf(ls.UserDN, name)
|
userDN = ls.UserDN
|
||||||
} else {
|
} else {
|
||||||
log.Trace("LDAP will use BindDN.")
|
log.Trace("LDAP will use BindDN.")
|
||||||
|
|
||||||
|
@ -100,7 +100,6 @@ func (ls Ldapsource) SearchEntry(name, passwd string, directBind bool) (string,
|
||||||
ls.Enabled = false
|
ls.Enabled = false
|
||||||
return "", "", "", false, false
|
return "", "", "", false, false
|
||||||
}
|
}
|
||||||
|
|
||||||
defer l.Close()
|
defer l.Close()
|
||||||
|
|
||||||
log.Trace("Binding with userDN: %s", userDN)
|
log.Trace("Binding with userDN: %s", userDN)
|
||||||
|
|
Loading…
Reference in a new issue