/*
- * inetconf.c
+ * $Id$
*
* Functions which handle Internet domain configuration etc.
*
- * $Id$
*/
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <pthread.h>
-#include <signal.h>
#include "webcit.h"
}
ic_misc = strdup("");
- output_headers(3);
- wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
- wprintf("<SPAN CLASS=\"titlebar\">Internet configuration</SPAN>\n");
- wprintf("</TD></TR></TABLE>\n");
-
serv_printf("CONF GETSYS|application/x-citadel-internet-config");
- serv_gets(buf);
- if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- extract(ename, buf, 0);
- extract(etype, buf, 1);
+ extract_token(ename, buf, 0, '|', sizeof ename);
+ extract_token(etype, buf, 1, '|', sizeof etype);
which = (-1);
for (i=0; i<ic_max; ++i) {
if (!strcasecmp(etype, ic_keyword[i])) {
}
- wprintf("<TABLE border=0 width=100%%><TR><TD VALIGN=TOP>\n");
+ output_headers(1, 1, 2, 0, 0, 0, 0);
+ wprintf("<div id=\"banner\">\n");
+ wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
+ wprintf("<SPAN CLASS=\"titlebar\">Internet configuration</SPAN>\n");
+ wprintf("</TD></TR></TABLE>\n");
+ wprintf("</div>\n<div id=\"content\">\n");
+
+ wprintf("<div id=\"fix_scrollbar_bug\">"
+ "<table border=0 width=100%%><tr><td valign=top>\n");
for (which=0; which<ic_max; ++which) {
if (which == (ic_max / 2)) {
wprintf("</TD><TD VALIGN=TOP>");
do_template("beginbox");
wprintf("<span class=\"menudesc\">");
escputs(ic_desc[which]);
- wprintf("</span><br>");
+ wprintf("</span><br />");
wprintf("<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>\n");
if (strlen(ic_spec[which]) > 0) {
for (i=0; i<num_tokens(ic_spec[which], '\n'); ++i) {
wprintf("<TR><TD ALIGN=LEFT>");
- extract_token(buf, ic_spec[which], i, '\n');
+ extract_token(buf, ic_spec[which], i, '\n', sizeof buf);
escputs(buf);
wprintf("</TD><TD ALIGN=RIGHT>"
"<A HREF=\"/save_inetconf?oper=delete&ename=");
"</TD></TR></TABLE></FORM>\n");
do_template("endbox");
}
- wprintf("</TD></TR></TABLE>\n");
-
+ wprintf("</td></tr></table></div>\n");
wDumpContent(1);
for (i=0; i<ic_max; ++i) {
void save_inetconf(void) {
- char buf[SIZ];
- char ename[SIZ];
- char etype[SIZ];
- char newconfig[65536];
+ char *buf;
+ char *ename;
+ char *etype;
+ char *newconfig;
+
+ buf = malloc(SIZ);
+ ename = malloc(SIZ);
+ etype = malloc(SIZ);
+ newconfig = malloc(65536);
strcpy(newconfig, "");
serv_printf("CONF GETSYS|application/x-citadel-internet-config");
- serv_gets(buf);
- if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
- extract(ename, buf, 0);
- extract(etype, buf, 1);
+ serv_getln(buf, SIZ);
+ if (buf[0] == '1') while (serv_getln(buf, SIZ), strcmp(buf, "000")) {
+ extract_token(ename, buf, 0, '|', SIZ);
+ extract_token(etype, buf, 1, '|', SIZ);
if (strlen(buf) == 0) {
/* skip blank lines */
}
}
serv_printf("CONF PUTSYS|application/x-citadel-internet-config");
- serv_gets(buf);
+ serv_getln(buf, SIZ);
if (buf[0] == '4') {
serv_puts(newconfig);
if (!strcasecmp(bstr("oper"), "add")) {
}
display_inetconf();
+
+ free(buf);
+ free(ename);
+ free(etype);
+ free(newconfig);
}