X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fnetconf.c;h=6886446ec90da2211fdffc70bedb9a5308a64e85;hb=abeb8adc38f9d55fcb6cb3d076f57239b0a9a4d5;hp=287a1a6881218f87bef3fa7dd8d9a407d92f27b7;hpb=ec1d922d70060c58db9982dee893f718850d338f;p=citadel.git diff --git a/webcit/netconf.c b/webcit/netconf.c index 287a1a688..6886446ec 100644 --- a/webcit/netconf.c +++ b/webcit/netconf.c @@ -1,9 +1,8 @@ /* - * netconf.c + * $Id$ * * Functions which handle network and sharing configuration. * - * $Id$ */ #include @@ -43,7 +42,7 @@ void edit_node(void) { serv_gets(buf); if (buf[0] == '1') { while (serv_gets(buf), strcmp(buf, "000")) { - extract(cnode, buf, 0); + extract_token(cnode, buf, 0, '|', sizeof cnode); if (strcasecmp(node, cnode)) { fprintf(fp, "%s\n", buf); } @@ -76,10 +75,12 @@ void edit_node(void) { void display_add_node(void) { - output_headers(3); - wprintf("
"); + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n"); + wprintf("
"); wprintf("Add new node"); wprintf("
\n"); + wprintf("
\n
\n"); wprintf("
\n"); wprintf("
\n"); @@ -91,8 +92,9 @@ void display_add_node(void) wprintf("\n"); wprintf(""); wprintf("\n"); - wprintf("
Port

"); + wprintf("

"); wprintf(""); + wprintf(" "); wprintf(""); wprintf("\n"); @@ -110,21 +112,23 @@ void display_edit_node(void) strcpy(node, bstr("node")); - output_headers(3); - wprintf("\n", chost); wprintf(""); wprintf("\n", cport); - wprintf("
"); + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n"); + wprintf("
"); wprintf("Edit node configuration for "); escputs(node); wprintf("\n"); wprintf("
\n"); + wprintf("
\n
\n"); serv_puts("CONF getsys|application/x-citadel-ignet-config"); serv_gets(buf); if (buf[0] == '1') { while (serv_gets(buf), strcmp(buf, "000")) { - extract(cnode, buf, 0); - extract(csecret, buf, 1); - extract(chost, buf, 2); - extract(cport, buf, 3); + extract_token(cnode, buf, 0, '|', sizeof cnode); + extract_token(csecret, buf, 1, '|', sizeof csecret); + extract_token(chost, buf, 2, '|', sizeof chost); + extract_token(cport, buf, 3, '|', sizeof cport); if (!strcasecmp(node, cnode)) { wprintf("
\n"); @@ -137,8 +141,9 @@ void display_edit_node(void) wprintf("
Port

"); + wprintf("
"); wprintf(""); + wprintf(" "); wprintf(""); wprintf("\n"); } @@ -147,7 +152,7 @@ void display_edit_node(void) } else { /* command error getting configuration */ - wprintf("%s
\n", &buf[4]); + wprintf("%s
\n", &buf[4]); } wDumpContent(1); @@ -160,17 +165,19 @@ void display_netconf(void) char buf[SIZ]; char node[SIZ]; - output_headers(3); - wprintf("
"); + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n"); + wprintf("
"); wprintf("Network configuration\n"); wprintf("
\n"); + wprintf("
\n
\n"); wprintf("
"); wprintf(""); - wprintf("Add a new node
\n"); + wprintf("Add a new node
\n"); wprintf("
"); - wprintf("
"); + wprintf("
"); wprintf("Currently configured nodes\n"); wprintf("
\n"); serv_puts("CONF getsys|application/x-citadel-ignet-config"); @@ -178,7 +185,7 @@ void display_netconf(void) if (buf[0] == '1') { wprintf("
\n"); while (serv_gets(buf), strcmp(buf, "000")) { - extract(node, buf, 0); + extract_token(node, buf, 0, '|', sizeof node); wprintf(""); @@ -200,19 +207,21 @@ void display_confirm_delete_node(void) { char node[SIZ]; - output_headers(3); - wprintf("
"); escputs(node); wprintf("
"); + output_headers(1, 1, 2, 0, 0, 0, 0); + wprintf("
\n"); + wprintf("
"); wprintf("Confirm delete\n"); wprintf("
\n"); + wprintf("
\n
\n"); strcpy(node, bstr("node")); wprintf("
Are you sure you want to delete "); escputs(node); - wprintf("?
\n"); + wprintf("?
\n"); wprintf("Yes   "); - wprintf("No
\n"); + wprintf("No
\n"); wDumpContent(1); } @@ -231,7 +240,7 @@ void delete_node(void) serv_gets(buf); if (buf[0] == '1') { while (serv_gets(buf), strcmp(buf, "000")) { - extract(cnode, buf, 0); + extract_token(cnode, buf, 0, '|', sizeof cnode); if (strcasecmp(node, cnode)) { fprintf(fp, "%s\n", buf); } @@ -269,7 +278,7 @@ void add_node(void) serv_puts(buf); serv_gets(buf); if (buf[0] == '1') { - output_headers(3); + output_headers(1, 1, 0, 0, 0, 0, 0); server_to_text(); wprintf("Back to menu\n"); wDumpContent(1);