From a2baa5053030da6baeec58d5378305c833ef0565 Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 29 Nov 2025 14:48:13 +0100 Subject: [PATCH] show users reports error if not admin --- src/core/console.cpp | 4 ++-- src/core/system.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/console.cpp b/src/core/console.cpp index ee7ff0532..f7141baf0 100644 --- a/src/core/console.cpp +++ b/src/core/console.cpp @@ -87,8 +87,8 @@ static void setup_commands(std::shared_ptr const & commands) { Command::show_all(shell); } else if (command == F_(system)) { EMSESP::system_.show_system(shell); - } else if (command == F_(users) && (shell.has_flags(CommandFlags::ADMIN))) { - EMSESP::system_.show_users(shell); // admin only + } else if (command == F_(users)) { + EMSESP::system_.show_users(shell); } else if (command == F_(devices)) { EMSESP::show_devices(shell); } else if (command == F_(log)) { diff --git a/src/core/system.cpp b/src/core/system.cpp index 7689ac501..9e7994c90 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -997,6 +997,11 @@ int8_t System::wifi_quality(int8_t dBm) { // print users to console void System::show_users(uuid::console::Shell & shell) { + if (!shell.has_flags(CommandFlags::ADMIN)) { + shell.printfln("Unauthorized. You need to be an admin to view users."); + return; + } + shell.printfln("Users:"); #ifndef EMSESP_STANDALONE