- if (found_sub != 0) {
- cprintf("%d '%s' is already subscribed to '%s'.\n",
- ERROR + ALREADY_EXISTS,
- email, qrbuf.QRname);
- return;
- }
-
- /*
- * Now add it to the file
- */
- begin_critical_section(S_NETCONFIGS);
- 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);
-}