char subtype[SIZ];
char buf[SIZ];
+ int self;
+ char sroom[SIZ];
strcpy(WC->wc_username, "");
strcpy(WC->wc_password, "");
);
wprintf("<TR><TD>Name of list</TD><TD>"
- "<INPUT TYPE=\"text\" NAME=\"room\" "
- "VALUE=\""
- );
- escputs(room);
- wprintf("\" MAXLENGTH=128></TD></TR>\n");
+ "<SELECT NAME=\"room\" SIZE=1>\n");
+
+ serv_puts("LPRM");
+ serv_gets(buf);
+ if (buf[0] == '1') {
+ while (serv_gets(buf), strcmp(buf, "000")) {
+ extract(sroom, buf, 0);
+ self = extract_int(buf, 4) & QR2_SELFLIST ;
+ if (self) {
+ wprintf("<OPTION VALUE=\"");
+ urlescputs(sroom);
+ wprintf("\">");
+ escputs(sroom);
+ wprintf("</OPTION>\n");
+ }
+ }
+ }
+ wprintf("</SELECT>"
+ "</TD></TR>\n");
wprintf("<TR><TD>Your e-mail address</TD><TD>"
"<INPUT TYPE=\"text\" NAME=\"email\" "
smart_goto(buf);
}
+
+
+
+
+/*
+ * Set/clear/read the "self-service list subscribe" flag for a room
+ *
+ * Set 'newval' to 0 to clear, 1 to set, any other value to leave unchanged.
+ * Always returns the new value.
+ */
+
+int self_service(int newval) {
+ int current_value = 0;
+ char buf[SIZ];
+
+ char name[SIZ];
+ char password[SIZ];
+ char dirname[SIZ];
+ int flags, floor, order, view, flags2;
+
+ serv_puts("GETR");
+ serv_gets(buf);
+ if (buf[0] != '2') return(0);
+
+ extract(name, &buf[4], 0);
+ extract(password, &buf[4], 1);
+ extract(dirname, &buf[4], 2);
+ flags = extract_int(&buf[4], 3);
+ floor = extract_int(&buf[4], 4);
+ order = extract_int(&buf[4], 5);
+ view = extract_int(&buf[4], 6);
+ flags2 = extract_int(&buf[4], 7);
+
+ if (flags2 & QR2_SELFLIST) {
+ current_value = 1;
+ }
+ else {
+ current_value = 0;
+ }
+
+ if (newval == 1) {
+ flags2 = flags2 | QR2_SELFLIST;
+ }
+ else if (newval == 0) {
+ flags2 = flags2 & ~QR2_SELFLIST;
+ }
+ else {
+ return(current_value);
+ }
+
+ if (newval != current_value) {
+ serv_printf("SETR %s|%s|%s|%d|0|%d|%d|%d|%d",
+ name, password, dirname, flags,
+ floor, order, view, flags2);
+ serv_gets(buf);
+ }
+
+ return(newval);
+
+}
+
+
+
+
+
+
/*
* display the form for editing a room
*/
/* Mailing list management */
if (!strcmp(tab, "listserv")) {
- wprintf("<BR><center><i>The contents of this room are being "
- "mailed to the following list recipients:"
+ wprintf("<BR><center>"
+ "<TABLE BORDER=0 WIDTH=100%% CELLPADDING=5>"
+ "<TR><TD VALIGN=TOP>");
+
+ wprintf("<i>The contents of this room are being "
+ "mailed <b>as individual messages</b> "
+ "to the following list recipients:"
"</i><br><br>\n");
serv_puts("GNET");
"<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"listrecp|\">\n");
wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
- wprintf("</FORM><BR></CENTER>\n");
+ wprintf("</FORM>\n");
+
+ wprintf("</TD><TD VALIGN=TOP>\n");
+
+ wprintf("<i>The contents of this room are being "
+ "mailed <b>in digest form</b> "
+ "to the following list recipients:"
+ "</i><br><br>\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(" <A HREF=\"/netedit&cmd=remove&line="
+ "digestrecp|");
+ urlescputs(recp);
+ wprintf("&tab=listserv\">(remove)</A><BR>");
+
+ }
+ }
+ wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/netedit\">\n"
+ "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
+ "<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"digestrecp|\">\n");
+ wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
+ wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
+ wprintf("</FORM>\n");
+
+ wprintf("</TD></TR></TABLE><HR>\n");
+
+ if (self_service(999) == 1) {
+ wprintf("This room is configured to allow "
+ "self-service subscribe/unsubscribe requests."
+ " <A HREF=\"/toggle_self_service?newval=0&"
+ "tab=listserv\">"
+ "Click to disable.</A><BR>\n"
+ );
+ }
+ else {
+ wprintf("This room is <i>not</i> configured to allow "
+ "self-service subscribe/unsubscribe requests."
+ " <A HREF=\"/toggle_self_service?newval=1&"
+ "tab=listserv\">"
+ "Click to enable.</A><BR>\n"
+ );
+ }
+
+
+ wprintf("</CENTER>\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
*/
#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 {
void create_floor(void);
void rename_floor(void);
void do_listsub(void);
+void toggle_self_service(void);