X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Flistsub%2Fserv_listsub.c;fp=citadel%2Fmodules%2Flistsub%2Fserv_listsub.c;h=7d7e93693ac6359147815ff6a20aed7cecb71b61;hb=224e9cc7a1a084568e136f7b959c32e177ce7ef8;hp=0c8335a50fd515faee319a58d72447297ef30a8c;hpb=60e1890d866f912f94b604f3af05bcd421109469;p=citadel.git diff --git a/citadel/modules/listsub/serv_listsub.c b/citadel/modules/listsub/serv_listsub.c index 0c8335a50..7d7e93693 100644 --- a/citadel/modules/listsub/serv_listsub.c +++ b/citadel/modules/listsub/serv_listsub.c @@ -192,8 +192,8 @@ void do_confirm(int cmd, char *roomname, char *emailaddr, char *url, char *gener int config_lines = 0; char *oldnetconfig, *newnetconfig; - // The server has generated a persistent confirmation token for the user+room combination. - // Let's see if the user has supplied the same token. + // During opt #1, the server generated a persistent confirmation token for the user+room combination. + // Let's see if the user has supplied the same token during opt #2. if (strcmp(generated_token, supplied_token)) { cprintf("%d This request could not be authenticated.\n", ERROR + PASSWORD_REQUIRED); return; @@ -254,10 +254,6 @@ void cmd_lsub(char *cmdbuf) { extract_token(url, cmdbuf, 3, '|', sizeof url); // token 3 is the URL at which we subscribed extract_token(supplied_token, cmdbuf, 4, '|', sizeof supplied_token); // token 4 is the token supplied by the caller - syslog(LOG_DEBUG, "cmd_lsub(cmd=%s, roomname=%s, emailaddr=%s, url=%s, token=%s", - cmd, roomname, emailaddr, url, supplied_token - ); - // First confirm that the caller is referencing a room that actually exists. if (CtdlGetRoom(&CC->room, roomname) != 0) { cprintf("%d There is no list called '%s'\n", ERROR + ROOM_NOT_FOUND, roomname); @@ -269,9 +265,10 @@ void cmd_lsub(char *cmdbuf) { return; } - // Room confirmed, now parse the command. + // Generate a confirmation token -- either to supply to the user for opt #1 or to compare for opt #2 generate_confirmation_token(generated_token, sizeof generated_token, roomname, emailaddr); + // Now parse the command. if (!strcasecmp(cmd, "subscribe")) { send_subscribe_confirmation_email(roomname, emailaddr, url, generated_token); }