From 05d7813835a1e2c9378251793779dc8367945021 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 26 Jan 2023 19:41:38 +0100 Subject: [PATCH] service: indicate which users are disabled in "user status" --- service.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/service.go b/service.go index 115638e..f1c3e8c 100644 --- a/service.go +++ b/service.go @@ -895,9 +895,17 @@ func handleUserStatus(ctx *serviceContext, params []string) error { ctx.user.srv.lock.Unlock() for _, user := range users { - line := user.Username + var attrs []string 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) if err != nil {