small bug fix
This commit is contained in:
parent
ddb11f0619
commit
d362159693
2 changed files with 9 additions and 6 deletions
|
|
@ -168,6 +168,9 @@ func (db *DB) UpdateUserSecret(username, secret string) error {
|
|||
}
|
||||
|
||||
func (db *DB) UpdateUserPassword(username, password string) error {
|
||||
if password == "" {
|
||||
return errors.New("empty password")
|
||||
}
|
||||
u, err := db.GetUser(username)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -507,14 +507,14 @@ func userEditHandler(ctx *Context) {
|
|||
Title: "Edit User",
|
||||
BodyTitle: "Edit User",
|
||||
}
|
||||
switch ctx.Method() {
|
||||
case "GET":
|
||||
u, err := ctx.Srv.DB.GetUserWithoutPassword(ctx.Var("user"))
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
return
|
||||
}
|
||||
ctx.Data.Data = u
|
||||
switch ctx.Method() {
|
||||
case "GET":
|
||||
ctx.Exec()
|
||||
case "POST":
|
||||
if !ctx.CheckXsrf() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue