diff --git a/invite.go b/invite.go index 5fb1ae5..ff8abb6 100644 --- a/invite.go +++ b/invite.go @@ -42,8 +42,9 @@ func handleInviteNewAccount(w http.ResponseWriter, r *http.Request) { // if login == nil { // return // } - - handleNewAccount(w, r, login.conn, login.Info.DN) + l, _ := ldap.DialURL(config.LdapServerAddr) + l.Bind(config.NewUserDN, config.NewUserPassword) + handleNewAccount(w, r, l, config.NewUserDN) } // New account creation using code diff --git a/utils.go b/utils.go index d905862..2c87db0 100644 --- a/utils.go +++ b/utils.go @@ -42,8 +42,7 @@ func suggestPassword() string { func addNewUser(newUser NewUser, config *ConfigFile) bool { log.Printf(fmt.Sprint("Adding New User")) - l := openLdap(*config) - l.Bind(config.NewUserDN, config.NewUserPassword) + // l.Bind(config.) dn := newUser.DN req := ldap.NewAddRequest(dn, nil)