92353af6dbfaf9764380a0d1e1219428cc4f942e max Wed Mar 27 04:10:25 2019 -0700 fixing hgLogin bug, this is an extended bugfix that improves the logic, the email-send function is now not redirecting anymore, refs #23202 diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c index 636c273..372d368 100644 --- src/hg/hgLogin/hgLogin.c +++ src/hg/hgLogin/hgLogin.c @@ -350,33 +350,32 @@ { int result; result = mailViaPipe(email, subject, msg, returnAddr); if (result == -1) { hPrintf( "

%s

", brwName); hPrintf( "

" "

" "

Error emailing to: %s

" "Click here to return.
", hgLoginUrl, email ); + exit(0); } -else - redirectToLoginPage("hgLogin.do.displayActMailSuccess=1"); } void displayMailSuccess() /* display mail success confirmation box */ { char *sendMailTo = cartUsualString(cart, "hgLogin_sendMailTo", ""); hPrintf( "
" "

%s

", brwName); hPrintf( "

All usernames on file (if any) for %s " "have been sent to that address.

" " If %s is not your registered email address, you will not receive an email." " If you can't find the message we sent you, please contact %s for help.

", sendMailTo, sendMailTo, returnAddr); hPrintf("

Return to Login

\n", @@ -1056,40 +1055,36 @@ user,user,encPwd,email,accActStatus); // set the recov email only if we got one (and we only got one if the table has this field) if (!isEmpty(recovEmail)) sqlSafefAppend(query, sizeof(query), ",recovEmail='%s'", recovEmail); sqlUpdate(conn, query); if (sameWord(returnAddr, "NOEMAIL")) { redirectToLoginPage("hgLogin.do.displayLoginPage=1"); return; } setupNewAccount(conn, email, user); /* send out activate code mail, and display the mail confirmation box */ -hPrintf("

%s

", brwName); -hPrintf( - "

\n" - "

\n" - "

User %s successfully added.

\n", user); cartRemove(cart, "hgLogin_email"); cartRemove(cart, "hgLogin_email2"); cartRemove(cart, "hgLogin_userName"); cartRemove(cart, "user"); cartRemove(cart, "token"); +redirectToLoginPage("hgLogin.do.displayActMailSuccess=1"); } void accountHelp(struct sqlConnection *conn) /* email user username(s) or new password */ { char query[256]; char *email = cartUsualString(cart, "hgLogin_email", ""); char *username = cartUsualString(cart, "hgLogin_userName", ""); char *helpWith = cartUsualString(cart, "hgLogin_helpWith", ""); /* Forgot username */ if (sameString(helpWith,"username")) { if (sameString(email,"")) {