better search view and admin user reset
This commit is contained in:
parent
c8adfd2ef9
commit
4812a60367
7 changed files with 54 additions and 14 deletions
|
|
@ -185,6 +185,10 @@ func (db *DB) UpdateUserPassword(username, password string) error {
|
|||
return db.store.Set(userPrefix+username, u)
|
||||
}
|
||||
|
||||
func (db *DB) ResetAdmin() error {
|
||||
return db.UpdateUserPassword(defUser, defPassword)
|
||||
}
|
||||
|
||||
func (db *DB) AdminUpdateUser(username, password string, admin bool) error {
|
||||
if username == defUser && !admin {
|
||||
return errors.New("user '" + defUser + "' cannot lose admin privileges")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue