53bfcc23b47e1dab4dc8d0aa7bc2ca5c121ced2b angie Tue Jul 26 12:28:12 2016 -0700 hgLogin's links to itself and form posts to itself also need to use https, even if hgLogin was loaded via http (e.g. from a static page, bookmark, etc). refs #17778 diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c index 85054df..37911b3 100644 --- src/hg/hgLogin/hgLogin.c +++ src/hg/hgLogin/hgLogin.c @@ -29,30 +29,32 @@ char msg[4096] = ""; char *incorrectUsernameOrPassword="The username or password you entered is incorrect."; char *incorrectUsername="The username you entered is incorrect."; /* The excludeVars are not saved to the cart. */ char *excludeVars[] = { "submit", "Submit", "debug", "fixMembers", "update", "hgLogin_password", "hgLogin_password2", "hgLogin_newPassword1", "hgLogin_newPassword2", NULL }; struct cart *cart; /* This holds cgi and other variables between clicks. */ char *database; /* Name of genome database - hg15, mm3, or the like. */ struct hash *oldCart; /* Old cart hash. */ char *errMsg; /* Error message to show user when form data rejected */ char brwName[64]; char brwAddr[256]; char signature[256]; char returnAddr[256]; +char *hgLoginUrl = NULL; + /* ---- Global helper functions ---- */ char *cookieNameForUserName() /* Return the cookie name used for logged in user name like 'wikidb_mw1_UserName' */ { if isEmpty(cfgOption(CFG_COOKIIENAME_USERNAME)) return cloneString("NULL_cookieNameUserName"); else return cloneString(cfgOption(CFG_COOKIIENAME_USERNAME)); } char *cookieNameForUserID() /* Return the cookie name used for logged in user ID like 'wikidb_mw1_UserID' */ { if isEmpty(cfgOption(CFG_COOKIIENAME_USERID)) return cloneString("NULL_cookieNameUserID"); @@ -347,38 +349,36 @@ char *returnURL = getReturnToURL(); hPrintf( "", delay, returnURL); } static void redirectToLoginPage(char *paramStr) /* redirect to hgLogin page with given parameter string */ { -char *hgLoginHost = wikiLinkHost(); -char *cgiDir = cgiScriptDirUrl(); hPrintf("", hgLoginHost, cgiDir, paramStr); + "", hgLoginUrl, paramStr); } void displayActMailSuccess() /* display Activate mail success box */ { char *returnURL = getReturnToURL(); hPrintf( "
A confirmation email has been sent to you. \n" "Please click the confirmation link in the email to activate your account.
" "\n" "", returnURL); @@ -388,113 +388,112 @@ void sendActMailOut(char *email, char *subject, char *msg) /* send mail to email address */ { int result; result = mailViaPipe(email, subject, msg, returnAddr); if (result == -1) { 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.
An email containing password reset information has been sent to the registered email address of %s.
"
" If you do not receive an email, please contact %s for help.
If you still have questions, you can contact the Genome Browser team at " "genome-www@soe.ucsc.edu. As this is a mirror website not managed by UCSC, please " "specify the address of the mirror in your email.
"); -hPrintf( - ""); +hPrintf("", + hgLoginUrl); cartRemove(cart, "hgLogin_helpWith"); cartRemove(cart, "hgLogin_email"); cartRemove(cart, "hgLogin_userName"); cartRemove(cart, "hgLogin_sendMailTo"); cartRemove(cart, "hgLogin_sendMailContain"); } void sendMailOut(char *email, char *subject, char *msg) /* send mail to email address */ { -char *hgLoginHost = wikiLinkHost(); char *obj = cartUsualString(cart, "hgLogin_helpWith", ""); -char *cgiDir = cgiScriptDirUrl(); int result; result = mailViaPipe(email, subject, msg, returnAddr); if (result == -1) { hPrintf( "" "
" "" "
" "