$Log$
+ Revision 591.100 2002/08/24 05:58:53 ajc
+ * Bugfixes and cosmetic changes to listsub system
+
Revision 591.99 2002/08/23 03:36:52 ajc
* Finished all of the subscribe/unsubscribe/confirm stuff!
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
syslog(LOG_NOTICE,"session %d: ended", con->cs_pid);
- /* If we have a message in cache, free it */
- if (CC->cached_msg != NULL) {
- phree(CC->cached_msg);
- }
-
/* Deallocate any user-data attached to this session */
deallocate_user_data(con);
struct cdbdata *cdbrec;
char key[SIZ];
- lprintf(9, "CtdlDirectoryLookup(%s)\n", internet_addr);
-
if (IsDirectory(internet_addr) == 0) return(-1);
directory_key(key, internet_addr);
if (cdbrec != NULL) {
safestrncpy(target, cdbrec->ptr, SIZ);
cdb_free(cdbrec);
- lprintf(9, "Looked up as <%s>\n", target);
return(0);
}
- lprintf(9, "Lookup failed\n");
return(-1);
}
*/
/*
- * Fetch the message from disk. We also keep the most recently
- * read message in memory, in case we want to read it again, or fetch
- * MIME parts out of it, or whatever.
+ * Fetch the message from disk.
*/
- if ( (CC->cached_msg != NULL) && (CC->cached_msgnum == msg_num) ) {
- TheMessage = CC->cached_msg;
- }
- else {
- TheMessage = CtdlFetchMessage(msg_num);
- if (CC->cached_msg != NULL) {
- phree(CC->cached_msg); /* FIXME efence? */
- }
- CC->cached_msg = TheMessage;
- CC->cached_msgnum = msg_num;
- }
+ TheMessage = CtdlFetchMessage(msg_num);
if (TheMessage == NULL) {
if (do_proto) cprintf("%d Can't locate msg %ld on disk\n",
TheMessage, msg_num, mode,
headers_only, do_proto, crlf);
- /* don't free the memory; we're keeping it in the cache */
- /* CtdlFreeMessage(TheMessage); */
+ CtdlFreeMessage(TheMessage);
return(retcode);
}
char *holdbuf = NULL;
int linelen = 0;
int buflen = 0;
- char success_message[SIZ];
- char success_message_to[SIZ];
- char address_of_list[SIZ];
- int i;
strcpy(address_to_unsubscribe, "");
- strcpy(success_message_to, "");
if (getroom(&qrbuf, room) != 0) {
cprintf("%d There is no list called '%s'\n",
return;
}
- /*
- * We'll just have this success message ready if we need it
- */
- sprintf(address_of_list, "room_%s@%s", qrbuf.QRname, config.c_fqdn);
- for (i=0; i<strlen(address_of_list); ++i) {
- if (isspace(address_of_list[i])) {
- address_of_list[i] = '_';
- }
- }
- snprintf(success_message, sizeof success_message,
- "Content-type: text/html\n\n"
- "<HTML><BODY>"
- "You have successfully subscribed to the <B>%s</B>\n"
- "mailing list.<BR><BR>To post to the list, simply send "
- "an e-mail to <TT>%s</TT>"
- "</BODY></HTML>\n",
- qrbuf.QRname,
- address_of_list
- );
-
/*
* Now start scanning this room's netconfig file for the
* specified token.
fseek(ncfp, line_offset, SEEK_SET);
fprintf(ncfp, "%s\n", buf);
++success;
- strcpy(success_message_to, email);
}
}
if (!strcasecmp(cmd, "unsubpending")) {
phree(holdbuf);
}
- /* Let 'em know it succeeded, and how to post to the list. */
- if (strlen(success_message_to) > 0) {
- quickie_message(
- "Citadel",
- success_message_to,
- NULL,
- success_message,
- FMT_RFC822,
- "Your subscription is complete"
- );
- }
-
/*
* Did we do anything useful today?
*/
size_t miscsize = 0;
size_t linesize = 0;
int skipthisline = 0;
+ int i;
lprintf(7, "Spooling <%s>\n", room_to_spool);
if (getroom(&CC->quickroom, room_to_spool) != 0) {
network_spool_msg, &sc);
/* If we wrote a digest, deliver it and then close it */
+ snprintf(buf, sizeof buf, "room_%s@%s",
+ CC->quickroom.QRname, config.c_fqdn);
+ for (i=0; i<strlen(buf); ++i) {
+ buf[i] = tolower(buf[i]);
+ if (isspace(buf[i])) buf[i] = '_';
+ }
if (sc.digestfp != NULL) {
fprintf(sc.digestfp, " -----------------------------------"
"------------------------------------"
"-------\n"
"You are subscribed to the '%s' "
- "list.\n",
- CC->quickroom.QRname
+ "list.\n"
+ "To post to the list: %s\n",
+ CC->quickroom.QRname, buf
);
network_deliver_digest(&sc); /* deliver and close */
}
char fake_hostname[64]; /* Fake hostname <bc> */
char fake_roomname[ROOMNAMELEN]; /* Fake roomname <bc> */
- struct CtdlMessage *cached_msg;
- long cached_msgnum;
char preferred_formats[SIZ]; /* Preferred MIME formats */
/* Dynamically allocated session data */
$Log$
+Revision 323.63 2002/08/24 05:59:24 ajc
+* Bugfixes and cosmetic changes to listsub system
+
Revision 323.62 2002/08/23 03:37:19 ajc
* Finished all of the subscribe/unsubscribe/confirm stuff! (I think)
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
wprintf("<CENTER><H1>Confirmation successful!</H1>");
}
else {
- wprintf("<CENTER><H1>Confirmation failed.</H1>");
+ wprintf("<CENTER><H1>Confirmation failed.</H1>"
+ "This could mean one of two things:<UL>\n"
+ "<LI>You waited too long to confirm your "
+ "subscribe/unsubscribe request (the "
+ "confirmation link is only valid for three "
+ "days)\n<LI>You have <i>already</i> "
+ "successfully confirmed your "
+ "subscribe/unsubscribe request and are "
+ "attempting to do it again.</UL>\n"
+ "The error returned by the server was: "
+ );
}
wprintf("%s</CENTER><BR>\n", &buf[4]);
}