service: indicate which users are disabled in "user status"
This commit is contained in:
parent
d7d9d45b45
commit
05d7813835
12
service.go
12
service.go
@ -895,9 +895,17 @@ func handleUserStatus(ctx *serviceContext, params []string) error {
|
|||||||
ctx.user.srv.lock.Unlock()
|
ctx.user.srv.lock.Unlock()
|
||||||
|
|
||||||
for _, user := range users {
|
for _, user := range users {
|
||||||
line := user.Username
|
var attrs []string
|
||||||
if user.Admin {
|
if user.Admin {
|
||||||
line += " (admin)"
|
attrs = append(attrs, "admin")
|
||||||
|
}
|
||||||
|
if !user.Enabled {
|
||||||
|
attrs = append(attrs, "disabled")
|
||||||
|
}
|
||||||
|
|
||||||
|
line := user.Username
|
||||||
|
if len(attrs) > 0 {
|
||||||
|
line += " (" + strings.Join(attrs, ", ") + ")"
|
||||||
}
|
}
|
||||||
networks, err := ctx.user.srv.db.ListNetworks(ctx, user.ID)
|
networks, err := ctx.user.srv.db.ListNetworks(ctx, user.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user