$Log$
+ Revision 591.93 2002/08/14 20:21:52 ajc
+ * Extend GETR/SETR to allow twiddling of bits in the QRflags2 bucket
+ * New flag and config options to allow/disallow self-service list subscription
+ and unsubscription to a room
+
Revision 591.92 2002/08/14 02:36:05 ajc
* WebCit list subscription integration
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
#define QR_MAILBOX 16384 /* Set if this is a private mailbox */
#define QR2_SYSTEM 1 /* System room; hide by default */
+#define QR2_SELFLIST 2 /* Self-service mailing list mgmt */
#define US_NEEDVALID 1 /* User needs to be validated */
#define US_PERM 4 /* Permanent user */
}
/* ...and now the other parameters */
- cprintf("|%u|%d|%d\n",
+ cprintf("|%u|%d|%d|%d\n",
qrbuf->QRflags,
(int) qrbuf->QRfloor,
- (int) qrbuf->QRorder);
+ (int) qrbuf->QRorder,
+ (int) qrbuf->QRflags2
+ );
}
if (CtdlAccessCheck(ac_room_aide)) return;
getroom(&CC->quickroom, CC->quickroom.QRname);
- cprintf("%d%c%s|%s|%s|%d|%d|%d|%d\n",
+ cprintf("%d%c%s|%s|%s|%d|%d|%d|%d|%d|\n",
CIT_OK,
CtdlCheckExpress(),
(int) CC->quickroom.QRfloor,
(int) CC->quickroom.QRorder,
- CC->quickroom.QRdefaultview);
+ CC->quickroom.QRdefaultview,
+ CC->quickroom.QRflags2
+ );
}
CC->quickroom.QRdefaultview = extract_int(args, 7);
}
+ /* Second set of flags */
+ if (num_parms(args) >= 9) {
+ CC->quickroom.QRflags2 = extract_int(args, 8);
+ }
+
/* Misc. flags */
CC->quickroom.QRflags = (extract_int(args, 3) | QR_INUSE);
/* Clean up a client boo-boo: if the client set the room to
char rpass[10];
char rdir[15];
unsigned rflags;
+ unsigned rflags2;
int rbump;
char raide[32];
char buf[SIZ];
int rfloor;
int rorder;
+ int rview;
int expire_mode = 0;
int expire_value = 0;
int r; /* IPC response code */
rflags = extract_int(&buf[4], 3);
rfloor = extract_int(&buf[4], 4);
rorder = extract_int(&buf[4], 5);
+ rview = extract_int(&buf[4], 6);
+ rflags2 = extract_int(&buf[4], 7);
rbump = 0;
/* Fetch the name of the current room aide */
set_room_attr(rflags, "Visible directory", QR_VISDIR);
}
rflags = set_room_attr(rflags, "Network shared room", QR_NETWORK);
+ rflags2 = set_room_attr(rflags2,
+ "Self-service list subscribe/unsubscribe",
+ QR2_SELFLIST);
rflags = set_room_attr(rflags,
"Automatically make all messages anonymous",
QR_ANONONLY);
r = CtdlIPCSetMessageExpirationPolicy(0, expire_mode,
expire_value, buf);
- snprintf(buf, sizeof buf, "SETR %s|%s|%s|%d|%d|%d|%d",
+ snprintf(buf, sizeof buf, "SETR %s|%s|%s|%d|%d|%d|%d|%d|%d",
rname, rpass, rdir, rflags, rbump, rfloor,
- rorder);
+ rorder, rview, rflags2);
serv_puts(buf);
serv_gets(buf);
scr_printf("%s\n", &buf[4]);
return;
}
+ if ((qrbuf.QRflags2 & QR2_SELFLIST) == 0) {
+ cprintf("%d '%s' "
+ "does not accept subscribe/unsubscribe requests.\n",
+ ERROR+HIGHER_ACCESS_REQUIRED, qrbuf.QRname);
+ return;
+ }
+
listsub_generate_token(token);
begin_critical_section(S_NETCONFIGS);
return;
}
+ if ((qrbuf.QRflags2 & QR2_SELFLIST) == 0) {
+ cprintf("%d '%s' "
+ "does not accept subscribe/unsubscribe requests.\n",
+ ERROR+HIGHER_ACCESS_REQUIRED, qrbuf.QRname);
+ return;
+ }
+
begin_critical_section(S_NETCONFIGS);
assoc_file_name(filename, sizeof filename, &qrbuf, "netconfigs");
ncfp = fopen(filename, "r+");
#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 */
-
+
+ Then it returns another '|' symbol, followed by a second set of bits comprised
+of the following:
+#define QR2_SYSTEM 1 /* System room; hide by default */
+#define QR2_SELFLIST 2 /* Self-service mailing list mgmt */
Other bits may be defined in the future. The listing terminates, as with
all listings, with "000" on a line by itself.
4. The floor number on which the room resides
5. The room listing order
6. The default view for the room (see views.txt)
+ 7. A second set of flags (bits) associated with the room
SETR (SET Room attributes)
5. The floor number on which the room should reside
6. The room listing order
7. The default view for the room (see views.txt)
+ 8. A second set of flags (buts) associated with the room
*Important: You should always use GETR to retrieve the current attributes of
the room, then change what you want to change, and then use SETR to write it