Implementing Activate User
This commit is contained in:
parent
154f0497b7
commit
524608b0bb
1 changed files with 18 additions and 5 deletions
23
invite.go
23
invite.go
|
@ -42,13 +42,26 @@ func handleInviteNewAccount(w http.ResponseWriter, r *http.Request) {
|
||||||
// l := ldapOpen(w)
|
// l := ldapOpen(w)
|
||||||
// l.Bind(config.NewUserDN, config.NewUserPassword)
|
// l.Bind(config.NewUserDN, config.NewUserPassword)
|
||||||
|
|
||||||
login := checkInviterLogin(w, r)
|
// login := checkInviterLogin(w, r)
|
||||||
if login == nil {
|
// if login == nil {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
// l, _ := ldap.DialURL(config.LdapServerAddr)
|
// l, _ := ldap.DialURL(config.LdapServerAddr)
|
||||||
// l.Bind(config.NewUserDN, config.NewUserPassword)
|
// l.Bind(config.NewUserDN, config.NewUserPassword)
|
||||||
handleNewAccount(w, r, login.conn, config.NewUserDN)
|
|
||||||
|
err, loginInfo := doLogin(w, r, "testuser", config.NewUserDN, config.NewUserPassword)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf(fmt.Sprintf("58: %v %v", err, loginInfo))
|
||||||
|
}
|
||||||
|
|
||||||
|
l := ldapOpen(w)
|
||||||
|
if l == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = l.Bind(loginInfo.DN, loginInfo.Password)
|
||||||
|
|
||||||
|
handleNewAccount(w, r, l, config.NewUserDN)
|
||||||
}
|
}
|
||||||
|
|
||||||
// New account creation using code
|
// New account creation using code
|
||||||
|
|
Loading…
Reference in a new issue