mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Can disable ldapServerPort by setting to empty string
This commit is contained in:
parent
b38654a45a
commit
b320cca789
@ -25,6 +25,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func StartLdapServer() {
|
func StartLdapServer() {
|
||||||
|
ldapServerPort := conf.GetConfigString("ldapServerPort")
|
||||||
|
if ldapServerPort == "" || ldapServerPort == "0" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
server := ldap.NewServer()
|
server := ldap.NewServer()
|
||||||
routes := ldap.NewRouteMux()
|
routes := ldap.NewRouteMux()
|
||||||
|
|
||||||
@ -32,7 +37,7 @@ func StartLdapServer() {
|
|||||||
routes.Search(handleSearch).Label(" SEARCH****")
|
routes.Search(handleSearch).Label(" SEARCH****")
|
||||||
|
|
||||||
server.Handle(routes)
|
server.Handle(routes)
|
||||||
err := server.ListenAndServe("0.0.0.0:" + conf.GetConfigString("ldapServerPort"))
|
err := server.ListenAndServe("0.0.0.0:" + ldapServerPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("StartLdapServer() failed, err = %s", err.Error())
|
log.Printf("StartLdapServer() failed, err = %s", err.Error())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user