From 3aac5cbcc78c8a19bc2aa0fc30da6f6b5503caa0 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 16 Aug 2002 22:06:51 +0000 Subject: [PATCH] * self-service --- webcit/ChangeLog | 4 ++ webcit/listsub.c | 26 +++++++-- webcit/roomops.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++- webcit/webcit.c | 2 + webcit/webcit.h | 43 +++++++++------ 5 files changed, 192 insertions(+), 24 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 2593dc1ec..66c2dfa0d 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 323.59 2002/08/16 22:06:51 ajc +* self-service + Revision 323.58 2002/08/16 03:51:12 ajc * I think I've finally nailed the 'no session' pages now... @@ -900,3 +903,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/listsub.c b/webcit/listsub.c index c58a7bad1..78eb3eab4 100644 --- a/webcit/listsub.c +++ b/webcit/listsub.c @@ -33,6 +33,8 @@ void do_listsub(void) char subtype[SIZ]; char buf[SIZ]; + int self; + char sroom[SIZ]; strcpy(WC->wc_username, ""); strcpy(WC->wc_password, ""); @@ -97,11 +99,25 @@ FORM: wprintf("
\n" ); wprintf("Name of list" - "\n"); + "" + "\n"); wprintf("Your e-mail address" "
The contents of this room are being " - "mailed to the following list recipients:" + wprintf("
" + "" + "
"); + + wprintf("The contents of this room are being " + "mailed as individual messages " + "to the following list recipients:" "

\n"); serv_puts("GNET"); @@ -988,13 +1059,77 @@ void display_editroom(void) "\n"); wprintf("\n"); wprintf(""); - wprintf("
\n"); + wprintf("\n"); + + wprintf("
\n"); + + wprintf("The contents of this room are being " + "mailed in digest form " + "to the following list recipients:" + "

\n"); + + serv_puts("GNET"); + serv_gets(buf); + if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) { + extract(cmd, buf, 0); + if (!strcasecmp(cmd, "digestrecp")) { + extract(recp, buf, 1); + + escputs(recp); + wprintf(" (remove)
"); + + } + } + wprintf("
\n" + "\n" + "\n"); + wprintf("\n"); + wprintf(""); + wprintf("
\n"); + + wprintf("

\n"); + + if (self_service(999) == 1) { + wprintf("This room is configured to allow " + "self-service subscribe/unsubscribe requests." + " " + "Click to disable.
\n" + ); + } + else { + wprintf("This room is not configured to allow " + "self-service subscribe/unsubscribe requests." + " " + "Click to enable.
\n" + ); + } + + + wprintf("
\n"); } wDumpContent(1); } +/* + * Toggle self-service list subscription + */ +void toggle_self_service(void) { + int newval = 0; + + newval = atoi(bstr("newval")); + self_service(newval); + display_editroom(); +} + + + /* * save new parameters for a room */ diff --git a/webcit/webcit.c b/webcit/webcit.c index 2700a6565..3a6f13ec9 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1151,6 +1151,8 @@ void session_loop(struct httprequest *req) change_start_page(); } else if (!strcasecmp(action, "display_floorconfig")) { display_floorconfig(NULL); + } else if (!strcasecmp(action, "toggle_self_service")) { + toggle_self_service(); } else if (!strcasecmp(action, "diagnostics")) { output_headers(1); diff --git a/webcit/webcit.h b/webcit/webcit.h index 001fbafba..62ed9e26e 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -24,22 +24,32 @@ #define USERCONFIGROOM "My Citadel Config" -/* Room flags (from Citadel) */ -#define QR_PERMANENT 1 /* Room does not purge */ -#define QR_INUSE 2 /* Set if in use, clear if avail */ -#define QR_PRIVATE 4 /* Set for any type of private room */ -#define QR_PASSWORDED 8 /* Set if there's a password too */ -#define QR_GUESSNAME 16 /* Set if it's a guessname room */ -#define QR_DIRECTORY 32 /* Directory room */ -#define QR_UPLOAD 64 /* Allowed to upload */ -#define QR_DOWNLOAD 128 /* Allowed to download */ -#define QR_VISDIR 256 /* Visible directory */ -#define QR_ANONONLY 512 /* Anonymous-Only room */ -#define QR_ANONOPT 1024 /* Anonymous-Option room */ -#define QR_NETWORK 2048 /* Shared network room */ -#define QR_PREFONLY 4096 /* Preferred status needed to enter */ -#define QR_READONLY 8192 /* Aide status required to post */ -#define QR_MAILBOX 16384 /* Set if this is a private mailbox */ +/* + * Room flags (from Citadel) + * + * bucket one... + */ +#define QR_PERMANENT 1 /* Room does not purge */ +#define QR_INUSE 2 /* Set if in use, clear if avail */ +#define QR_PRIVATE 4 /* Set for any type of private room */ +#define QR_PASSWORDED 8 /* Set if there's a password too */ +#define QR_GUESSNAME 16 /* Set if it's a guessname room */ +#define QR_DIRECTORY 32 /* Directory room */ +#define QR_UPLOAD 64 /* Allowed to upload */ +#define QR_DOWNLOAD 128 /* Allowed to download */ +#define QR_VISDIR 256 /* Visible directory */ +#define QR_ANONONLY 512 /* Anonymous-Only room */ +#define QR_ANONOPT 1024 /* Anonymous-Option room */ +#define QR_NETWORK 2048 /* Shared network room */ +#define QR_PREFONLY 4096 /* Preferred status needed to enter */ +#define QR_READONLY 8192 /* Aide status required to post */ +#define QR_MAILBOX 16384 /* Set if this is a private mailbox */ + +/* + * bucket two... + */ +#define QR2_SYSTEM 1 /* System room; hide by default */ +#define QR2_SELFLIST 2 /* Self-service mailing list mgmt */ struct httprequest { @@ -320,3 +330,4 @@ void delete_floor(void); void create_floor(void); void rename_floor(void); void do_listsub(void); +void toggle_self_service(void); -- 2.30.2