X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserv_listsub.c;h=53bf0c76e97e1a73af34939ddeee956e7da7b568;hb=d65dd711bf8271c815441f826fc0b24e3d6b49ae;hp=a18d8cbbb29f4ba6ffcf6e07fc427b3ab7c0d4d4;hpb=3aac5cbcc78c8a19bc2aa0fc30da6f6b5503caa0;p=citadel.git diff --git a/citadel/serv_listsub.c b/citadel/serv_listsub.c index a18d8cbbb..53bf0c76e 100644 --- a/citadel/serv_listsub.c +++ b/citadel/serv_listsub.c @@ -68,10 +68,8 @@ void listsub_generate_token(char *buf) { * tinfoil-hat secure, it just needs to be reasonably unguessable * and unique. */ - sprintf(sourcebuf, "%d%d%ld", - ++seq, - getpid(), - time(NULL) + sprintf(sourcebuf, "%lx", + (long) (++seq + getpid() + time(NULL)) ); /* Convert it to base64 so it looks cool */ @@ -88,6 +86,7 @@ void do_subscribe(char *room, char *email, char *subtype, char *webpage) { char filename[SIZ]; char token[SIZ]; char confirmation_request[SIZ]; + char urlroom[SIZ]; if (getroom(&qrbuf, room) != 0) { cprintf("%d There is no list called '%s'\n", ERROR, room); @@ -120,28 +119,32 @@ void do_subscribe(char *room, char *email, char *subtype, char *webpage) { /* Generate and send the confirmation request */ + urlesc(urlroom, qrbuf.QRname); + snprintf(confirmation_request, sizeof confirmation_request, + "Content-type: text/html\n\n" + "" "Someone (probably you) has submitted a request to subscribe\n" - "<%s> to the '%s' mailing list.\n\n" - "In order to confirm this subscription request, please\n" - "point your web browser at the following location:\n\n" - "http://%s?room=%s&token=%s\n\n" + "<%s> to the %s mailing list.

\n" + "" + "Please click here to confirm this request.

\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", + "and you will not receive any further mailings.\n" + "\n", - email, qrbuf.QRname, webpage, qrbuf.QRname, token, qrbuf.QRname + email, qrbuf.QRname, webpage, urlroom, token, qrbuf.QRname ); - quickie_message( + quickie_message( /* This delivers the message */ "Citadel", email, - qrbuf.QRname, - confirmation_request + NULL, + confirmation_request, + FMT_RFC822 ); cprintf("%d Subscription entered; confirmation request sent\n", CIT_OK); - }