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

pull/1874/head
Roger A. Light 5 years ago
parent 5b28fac61d
commit 866c395dcc

@ -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);

Loading…
Cancel
Save