]> mj.ucw.cz Git - subauth.git/commitdiff
When listing zones, include temp token validity limit
authorMartin Mares <mj@ucw.cz>
Wed, 6 Sep 2017 21:06:34 +0000 (23:06 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 6 Sep 2017 21:06:34 +0000 (23:06 +0200)
client/subauth.c
server/cmd.c

index 9c65297da84303f4e9dc1da7b97e6f9b97523e98..44c9fefece6bc4956030d4e8b958321d2878d632 100644 (file)
@@ -275,7 +275,7 @@ static void cmd_zones(void)
   op_run();
 
   struct json_node **jzs = need_child(rp, "zones", JSON_ARRAY)->elements;
-  printf("%-16s %6s %6s  %s\n", "Zone", "Passwd", "Tokens", "Description");
+  printf("%-16s %6s %6s %6s  %s\n", "Zone", "Passwd", "Tokens", "MaxTmp", "Description");
   for (uint i=0; i < GARY_SIZE(jzs); i++)
     {
       struct json_node *jz = jzs[i];
@@ -283,10 +283,12 @@ static void cmd_zones(void)
       struct json_node *jdesc = get_child(jz, "desc", JSON_STRING);
       struct json_node *jpass = get_child(jz, "allow-passwd", JSON_NUMBER);
       struct json_node *jtokens = get_child(jz, "allow-tokens", JSON_NUMBER);
-      printf("%-16s %6s %6d  %s\n",
+      struct json_node *jtemp = get_child(jz, "max-temp-validity", JSON_NUMBER);
+      printf("%-16s %6s %6d %6d  %s\n",
        jname->string,
        (jpass && jpass->number ? "yes" : "-"),
        (jtokens ? (uint) jtokens->number : 0),
+       (jtemp ? (uint) jtemp->number : 0),
        (jdesc ? jdesc->string : "(no description)"));
     }
 }
index 106d1ef142be01c55d99bed9bc57368b14f4b413..fb8d698b51a3224abe63788c03ee2da6a6fd08fa 100644 (file)
@@ -496,6 +496,7 @@ static void cmd_list_zones(struct client *c)
       set_string(c, jz, "desc", az->desc);
       set_uint(c, jz, "allow-passwd", az->allow_passwd);
       set_uint(c, jz, "allow-tokens", az->allow_tokens);
+      set_uint(c, jz, "max-temp-validity", az->max_temp_validity);
     }
 
   cmd_ok(c);