X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fnetconf.c;h=ee7c5a91fd7f4bf4e30dbe568453873f71c99fa8;hb=9f145319b92b196662aa51cb2e3d7c392629965e;hp=49836b2f3994b7ef1f2edde43bb3ac544a74d858;hpb=523c1b0f7a3002c6aaa3eb833b55eb0cf07674ff;p=citadel.git diff --git a/webcit/netconf.c b/webcit/netconf.c index 49836b2f3..ee7c5a91f 100644 --- a/webcit/netconf.c +++ b/webcit/netconf.c @@ -1,19 +1,24 @@ /* * $Id$ + */ +/** + * \defgroup NetShareConf Functions which handle network and sharing configuration. * - * Functions which handle network and sharing configuration. - * + * \ingroup CitadelConfig */ - +/*@{*/ #include "webcit.h" +/** + * \brief edit a network node + */ void edit_node(void) { char buf[SIZ]; char node[SIZ]; char cnode[SIZ]; FILE *fp; - if (strlen(bstr("ok_button")) > 0) { + if (havebstr("ok_button")) { strcpy(node, bstr("node") ); fp = tmpfile(); if (fp != NULL) { @@ -26,24 +31,28 @@ void edit_node(void) { fprintf(fp, "%s\n", buf); } } - fprintf(fp, "%s|%s|%s|%s\n", - bstr("node"), - bstr("secret"), - bstr("host"), - bstr("port") ); - } rewind(fp); + } - serv_puts("CONF putsys|application/x-citadel-ignet-config"); - serv_getln(buf, sizeof buf); - if (buf[0] == '4') { + serv_puts("CONF putsys|application/x-citadel-ignet-config"); + serv_getln(buf, sizeof buf); + if (buf[0] == '4') { + if (fp != NULL) { while (fgets(buf, sizeof buf, fp) != NULL) { buf[strlen(buf)-1] = 0; - serv_puts(buf); + if (buf[0] != 0) { + serv_puts(buf); + } } - serv_puts("000"); + fclose(fp); } - fclose(fp); + serv_printf("%s|%s|%s|%s", + bstr("node"), + bstr("secret"), + bstr("host"), + bstr("port") ); + } + serv_puts("000"); } } @@ -51,19 +60,22 @@ void edit_node(void) { } - +/** + * \brief add a node + */ void display_add_node(void) { output_headers(1, 1, 2, 0, 0, 0); wprintf("
\n