Skip to content

Commit

Permalink
minor text changes
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Oct 11, 2021
1 parent d6711ac commit f42c265
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *

// check if we're allowed to call it
if (cf->has_flags(CommandFlag::ADMIN_ONLY) && !authenticated) {
LOG_WARNING(F("Command %s on %s not permitted. requires admin."), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
LOG_WARNING(F("Command %s on %s requires valid authorization"), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
return CommandRet::NOT_ALLOWED;
}

Expand Down Expand Up @@ -71,8 +71,8 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *

// check if we're allowed to call it
if (cf != nullptr) {
if (cf->has_flags(CommandFlag::ADMIN_ONLY) && !authenticated && value != nullptr) {
LOG_WARNING(F("Command %s on %s not permitted. requires admin."), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
if (cf->has_flags(CommandFlag::ADMIN_ONLY) && !authenticated) {
LOG_WARNING(F("Command %s on %s requires valid authorization"), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
return CommandRet::NOT_ALLOWED; // command not allowed
}
}
Expand All @@ -83,7 +83,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
} else if (id == -1) {
LOG_INFO(F("Calling %s command '%s', value %s, id is default"), dname.c_str(), cmd, value);
} else {
LOG_INFO(F("Calling %s command '%s', value %s, id is %d"), dname.c_str(), cmd, value, id);
LOG_INFO(F("Calling %s command '%s', value %s, id is %d"), dname.c_str(), cmd, value, id_new);
}

// check if json object is empty, if so quit
Expand Down Expand Up @@ -306,7 +306,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
if (cf.has_flags(CommandFlag::ADMIN_ONLY)) {
shell.print(' ');
shell.print(COLOR_BRIGHT_RED);
shell.print('*');
shell.print('!');
}
shell.print(COLOR_RESET);
}
Expand Down Expand Up @@ -367,7 +367,7 @@ void Command::show_devices(uuid::console::Shell & shell) {
// output list of all commands to console
// calls show with verbose mode set
void Command::show_all(uuid::console::Shell & shell) {
shell.println(F("Available commands (* = need authorization): "));
shell.println(F("Available commands (!=requires authorization): "));

// show system first
shell.print(COLOR_BOLD_ON);
Expand Down

0 comments on commit f42c265

Please sign in to comment.