mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-22 08:04:23 +08:00
Dynsec: Add "disabled" property for getClient/listClients.
This commit is contained in:
@@ -142,6 +142,11 @@ static void print_client(cJSON *j_response)
|
||||
printf("Clientid:\n");
|
||||
}
|
||||
|
||||
jtmp = cJSON_GetObjectItem(j_client, "disabled");
|
||||
if(jtmp && cJSON_IsBool(jtmp)){
|
||||
printf("Disabled: %s\n", cJSON_IsTrue(jtmp)?"true":"false");
|
||||
}
|
||||
|
||||
j_array = cJSON_GetObjectItem(j_client, "roles");
|
||||
if(j_array && cJSON_IsArray(j_array)){
|
||||
first = true;
|
||||
|
||||
@@ -676,6 +676,7 @@ static cJSON *add_client_to_json(struct dynsec__client *client, bool verbose)
|
||||
|| (client->clientid && cJSON_AddStringToObject(j_client, "clientid", client->clientid) == NULL)
|
||||
|| (client->text_name && cJSON_AddStringToObject(j_client, "textname", client->text_name) == NULL)
|
||||
|| (client->text_description && cJSON_AddStringToObject(j_client, "textdescription", client->text_description) == NULL)
|
||||
|| (client->disabled && cJSON_AddBoolToObject(j_client, "disabled", client->disabled) == NULL)
|
||||
){
|
||||
|
||||
cJSON_Delete(j_client);
|
||||
|
||||
Reference in New Issue
Block a user