From f4246d48f00ea906ffe3e04fb3024965b60b1fee Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 10 Jan 1999 01:41:25 +0000 Subject: [PATCH] lotsa stuff --- webcit/cookie_conversion.c | 43 ++++++++++ webcit/siteconfig.c | 164 +++++++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+) create mode 100644 webcit/cookie_conversion.c create mode 100644 webcit/siteconfig.c diff --git a/webcit/cookie_conversion.c b/webcit/cookie_conversion.c new file mode 100644 index 000000000..2f11c211b --- /dev/null +++ b/webcit/cookie_conversion.c @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include +#include +#include +#include "webcit.h" +#include "child.h" + +/* + * Pack all session info into one easy-to-digest cookie. Healthy and delicious! + */ +void stuff_to_cookie(char *cookie, int session, char *user, char *pass, char *room) { + char buf[256]; + int i; + + sprintf(buf, "%d|%s|%s|%s", session, user, pass, room); + strcpy(cookie, ""); + + for (i=0; i +#include +#include +#include +#include +#include +#include +#include "webcit.h" +#include "child.h" + + +void display_siteconfig(void) { + char buf[256]; + int i = 0; + + serv_printf("CONF get"); + serv_gets(buf); + if (buf[0]!='1') { + display_error(&buf[4]); + return; + } + + printf("HTTP/1.0 200 OK\n"); + output_headers(1); + + wprintf("
"); + wprintf("Site configuration"); + wprintf("
\n"); + + wprintf("
\n"); + wprintf("\n"); + + while (serv_gets(buf), strcmp(buf, "000")) { + ++i; + switch(i) { + case 1: wprintf("\n"); + break; + case 2: wprintf("\n"); + break; + case 3: wprintf("\n"); + break; + case 4: wprintf("\n"); + break; + case 5: wprintf("\n"); + break; + case 6: wprintf("\n"); + break; + case 7: wprintf("\n"); + break; + case 8: wprintf("\n"); + break; + case 9: wprintf("\n"); + break; + case 10:wprintf("\n"); + break; + case 11:wprintf("\n"); + break; + case 12:wprintf("\n"); + break; + case 13:wprintf("\n"); + break; + case 14:wprintf("\n"); + break; + case 15:wprintf("\n"); + break; + case 16:wprintf("\n"); + break; + case 17:wprintf("\n"); + break; + case 18:wprintf("\n"); + break; + case 19:wprintf("\n"); + break; + } + } + + wprintf("
Node name"); + wprintf("", buf); + wprintf("
Fully qualified domain name"); + wprintf("", buf); + wprintf("
Human-readable node name"); + wprintf("", buf); + wprintf("
Landline telephone number"); + wprintf("", buf); + wprintf("
Automatically grant room-aide status to users who create private rooms"); + wprintf("", (atoi(buf) ? "yes" : "no")); + wprintf("
Server connection idle timeout (in seconds)"); + wprintf("", buf); + wprintf("
Initial access level for new users"); + wprintf("", buf); + wprintf("
Require registration for new users"); + wprintf("", (atoi(buf) ? "yes" : "no")); + wprintf("
Move problem user messages to twitroom"); + wprintf("", (atoi(buf) ? "yes" : "no")); + wprintf("
Name of twitroom"); + wprintf("", buf); + wprintf("
Paginator prompt"); + wprintf("", buf); + wprintf("
Restrict access to Internet mail"); + wprintf("", (atoi(buf) ? "yes" : "no")); + wprintf("
Geographic location of this system"); + wprintf("", buf); + wprintf("
Name of system administrator"); + wprintf("", buf); + wprintf("
Maximum concurrent sessions"); + wprintf("", buf); + wprintf("
Maximum concurrent sessions"); + wprintf("", buf); + wprintf("
Default user purge time (days)"); + wprintf("", buf); + wprintf("
Default room purge time (days)"); + wprintf("", buf); + wprintf("
Name of room to log pages"); + wprintf("", buf); + wprintf("
"); + wprintf(""); + wprintf("\n"); + wprintf("
\n"); + wDumpContent(); +} + + +void siteconfig(void) { + char buf[256]; + + if (strcasecmp(bstr("sc"), "OK")) { + display_main_menu(); + return; + } + + serv_printf("SEXP ignatius t foobar|-"); + serv_gets(buf); + if (buf[0]!='4') { + display_error(&buf[4]); + return; + } + + serv_printf("%s", bstr("c_nodename")); + serv_printf("%s", bstr("c_fqdn")); + serv_printf("%s", bstr("c_humannode")); + serv_printf("%s", bstr("c_phonenum")); + serv_printf("%s", ( (!strcasecmp(bstr("c_creataide"), "yes") ? 1 : 0))); + serv_printf("%s", bstr("c_sleeping")); + serv_printf("%s", bstr("c_initax")); + serv_printf("%s", ( (!strcasecmp(bstr("c_regiscall"), "yes") ? 1 : 0))); + serv_printf("%s", ( (!strcasecmp(bstr("c_twitdetect"), "yes") ? 1 : 0))); + serv_printf("%s", bstr("c_twitroom")); + serv_printf("%s", bstr("c_moreprompt")); + serv_printf("%s", ( (!strcasecmp(bstr("c_restrict"), "yes") ? 1 : 0))); + serv_printf("%s", bstr("c_bbs_city")); + serv_printf("%s", bstr("c_sysadm")); + serv_printf("%s", bstr("c_maxsessions")); + serv_printf("%s", bstr("c_net_password")); + serv_printf("%s", bstr("c_userpurge")); + serv_printf("%s", bstr("c_roompurge")); + serv_printf("%s", bstr("c_logpages")); + serv_printf("000"); + display_main_menu(); +} -- 2.39.2