- ncfp = fopen(filename, "a");
- if (ncfp != NULL) {
- fprintf(ncfp, "subpending|%s|%s|%s|%ld|%s\n",
- email,
- subtype,
- token,
- time(NULL),
- webpage
- );
- fclose(ncfp);
- }
- end_critical_section(S_NETCONFIGS);
-
- /* Generate and send the confirmation request */
-
- urlesc(urlroom, ROOMNAMELEN, qrbuf.QRname);
-
- snprintf(confirmation_request, sizeof confirmation_request,
-
- "MIME-Version: 1.0\n"
- "Content-Type: multipart/alternative; boundary=\"__ctdlmultipart__\"\n"
- "\n"
- "This is a multipart message in MIME format.\n"
- "\n"
- "--__ctdlmultipart__\n"
- "Content-type: text/plain\n"
- "\n"
- "Someone (probably you) has submitted a request to subscribe\n"
- "<%s> to the '%s' mailing list.\n"
- "\n"
- "Please go here to confirm this request:\n"
- " %s?room=%s&token=%s&cmd=confirm \n"
- "\n"
- "If this request has been submitted in error and you do not\n"
- "wish to receive the '%s' mailing list, simply do nothing,\n"
- "and you will not receive any further mailings.\n"
- "\n"
- "--__ctdlmultipart__\n"
- "Content-type: text/html\n"
- "\n"
- "<HTML><BODY>\n"
- "Someone (probably you) has submitted a request to subscribe\n"
- "<%s> to the <B>%s</B> mailing list.<BR><BR>\n"
- "Please click here to confirm this request:<BR>\n"
- "<A HREF=\"%s?room=%s&token=%s&cmd=confirm\">"
- "%s?room=%s&token=%s&cmd=confirm</A><BR><BR>\n"
- "If this request has been submitted in error and you do not\n"
- "wish to receive the '%s' mailing list, simply do nothing,\n"
- "and you will not receive any further mailings.\n"
- "</BODY></HTML>\n"
- "\n"
- "--__ctdlmultipart__--\n",
-
- email, qrbuf.QRname,
- webpage, urlroom, token,
- qrbuf.QRname,
-
- email, qrbuf.QRname,
- webpage, urlroom, token,
- webpage, urlroom, token,
- qrbuf.QRname
- );
-
- quickie_message( /* This delivers the message */
- "Citadel",
- NULL,
- email,
- NULL,
- confirmation_request,
- FMT_RFC822,
- "Please confirm your list subscription"
- );
-
- cprintf("%d Subscription entered; confirmation request sent\n", CIT_OK);
-}
-
-
-/*
- * Enter an unsubscription request
- */
-void do_unsubscribe(char *room, char *email, char *webpage) {
- struct ctdlroom qrbuf;
- FILE *ncfp;
- char filename[256];
- char token[256];
- char buf[512];
- char confirmation_request[2048];
- char urlroom[ROOMNAMELEN];
- char scancmd[256];
- char scanemail[256];
- int found_sub = 0;
-
- if (getroom(&qrbuf, room) != 0) {
- cprintf("%d There is no list called '%s'\n",
- ERROR + ROOM_NOT_FOUND, room);
- return;