Dynsec: Add "disabled" property for getClient/listClients.

This commit is contained in:
Roger A. Light
2020-10-30 12:35:34 +00:00
parent 5b28fac61d
commit 866c395dcc
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -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;
+1
View File
@@ -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);