fix: get user account
This commit is contained in:
parent
8278b74ae8
commit
0d3a68997a
|
@ -7,6 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type account struct {
|
type account struct {
|
||||||
|
User string
|
||||||
Salt string `prosody:"salt"`
|
Salt string `prosody:"salt"`
|
||||||
StoredKey string `prosody:"stored_key"`
|
StoredKey string `prosody:"stored_key"`
|
||||||
IterationCount string `prosody:"iteration_count"`
|
IterationCount string `prosody:"iteration_count"`
|
||||||
|
@ -47,7 +48,9 @@ func (p *Prosody) loadAccount(username string) (*account, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
acc := &account{}
|
acc := &account{
|
||||||
|
User: username,
|
||||||
|
}
|
||||||
acc.unmarshal(mapValues)
|
acc.unmarshal(mapValues)
|
||||||
return acc, nil
|
return acc, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ func (p *Prosody) ChangePassword(user string, currentPwd string, newPwd string)
|
||||||
return errors.New("password is incorrect")
|
return errors.New("password is incorrect")
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command("/usr/bin/prosodyctl", "passwd", user+"@"+p.plainDomain)
|
cmd := exec.Command("/usr/bin/prosodyctl", "passwd", acc.User+"@"+p.plainDomain)
|
||||||
// Create a pipe to write to the process's standard input.
|
// Create a pipe to write to the process's standard input.
|
||||||
stdin, err := cmd.StdinPipe()
|
stdin, err := cmd.StdinPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue