mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-07 17:47:14 +00:00
userdb: Add a method to remove users
This patch adds a method to userdb to remove users. It will not be used by chasquid, but by the command-line tool.
This commit is contained in:
@@ -191,6 +191,17 @@ func (db *DB) AddUser(name, plainPassword string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemoveUser from the database. Returns True if the user was there, False
|
||||
// otherwise.
|
||||
func (db *DB) RemoveUser(name string) bool {
|
||||
db.mu.Lock()
|
||||
|
||||
_, present := db.db.Users[name]
|
||||
delete(db.db.Users, name)
|
||||
db.mu.Unlock()
|
||||
return present
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Encryption schemes
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user