304aeae270067c5854358e2c4475ea34419dfec7 gperez2 Thu Aug 27 17:59:26 2026 -0700 Updating hgLogin's buttons, form labels, and two error messages to sentence case matching the Track QA Guidelines wiki page, refs #37929 diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c index 54a2715a332..fa12b64a3ca 100644 --- src/hg/hgLogin/hgLogin.c +++ src/hg/hgLogin/hgLogin.c @@ -925,58 +925,58 @@ hPrintf( "<h3>Change Password</h3>" "\n" "<p> <span style='color:red;'>%s</span> </p>" "\n" "<form method=\"post\" action=\"%s\" name=\"changePasswordForm\" id=\"changePasswordForm\">" "\n" "<div class=\"inputGroup\">" "<label for=\"userName\">Username</label>" "<input type=\"text\" name=\"hgLogin_userName\" size=\"30\" value=\"%s\" id=\"email\">" "</div>" "\n", errMsg ? errMsg : "", hgLoginUrl, htmlEncode(cartUsualString(cart, "hgLogin_userName", ""))); // value="" attribute; escape (XSS) hPrintf("<div class=\"inputGroup\">" "\n" - "<label for=\"currentPw\">Current or Emailed Password</label>" + "<label for=\"currentPw\">Current or emailed password</label>" "<span style=\"display:inline-flex; align-items:center;\">" "<input type=\"password\" name=\"hgLogin_password\" value=\"\" size=\"30\" id=\"currentPw\">"); printPwdEyeIcon("curPwEyeIcon", "curPwEyeSlash"); hPrintf( "</span>" "</div>" "\n" "<div class=\"inputGroup\">" - "<label for=\"newPw1\">New Password</label>" + "<label for=\"newPw1\">New password</label>" "<span style=\"display:inline-flex; align-items:center;\">" "<input type=\"password\" name=\"hgLogin_newPassword1\" value=\"\" size=\"30\" id=\"newPw1\">"); printPwdEyeIcon("newPw1EyeIcon", "newPw1EyeSlash"); hPrintf( "</span>" "</div>" "\n" "<div class=\"inputGroup\">" - "<label for=\"newPw2\">Re-enter New Password</label>" + "<label for=\"newPw2\">Re-enter new password</label>" "<span style=\"display:inline-flex; align-items:center;\">" "<input type=\"password\" name=\"hgLogin_newPassword2\" value=\"\" size=\"30\" id=\"newPw2\">"); printPwdEyeIcon("newPw2EyeIcon", "newPw2EyeSlash"); hPrintf( "</span>" "</div>" "\n" "<div class=\"formControls\">" - " <input type=\"submit\" name=\"hgLogin.do.changePassword\" value=\"Change Password\" class=\"largeButton\"> " + " <input type=\"submit\" name=\"hgLogin.do.changePassword\" value=\"Change password\" class=\"largeButton\"> " " <a href=\"%s\" class=\"cancelButton\">Cancel</a>" "\n" "</div>" "</form>" "\n" "</div><!-- END - changePwBox -->" "\n", getReturnToUrlForAttr()); if (pwdEyeIconEnabled) { printPwdToggleJS(); jsOnEventById("click", "curPwEyeIcon", "togglePwdVisibility('currentPw','curPwEyeSlash');"); jsOnEventById("click", "newPw1EyeIcon", "togglePwdVisibility('newPw1','newPw1EyeSlash');"); jsOnEventById("click", "newPw2EyeIcon", "togglePwdVisibility('newPw2','newPw2EyeSlash');"); } cartSaveSession(cart); @@ -997,38 +997,38 @@ errMsg = cloneString("Username cannot be blank."); changePasswordPage(conn); return; } if (!currentPassword || sameString(currentPassword,"")) { freez(&errMsg); errMsg = cloneString("Current password cannot be blank."); changePasswordPage(conn); return; } if (!newPassword1 || sameString(newPassword1,"") || (strlen(newPassword1)<5)) { freez(&errMsg); - errMsg = cloneString("New Password must be at least 5 characters long."); + errMsg = cloneString("New password must be at least 5 characters long."); changePasswordPage(conn); return; } if (!newPassword2 || sameString(newPassword2,"") ) { freez(&errMsg); - errMsg = cloneString("Re-enter New Password field cannot be blank."); + errMsg = cloneString("Re-enter new password field cannot be blank."); changePasswordPage(conn); return; } if (newPassword1 && newPassword2 && !sameString(newPassword1, newPassword2)) { freez(&errMsg); errMsg = cloneString("New passwords do not match."); changePasswordPage(conn); return; } /* check username existence and is user using a new password */ char *password; if (changeRequired && sameString(changeRequired, "YES")) { sqlSafef(query,sizeof(query), "SELECT newPassword FROM gbMembers WHERE userName='%s'", user); @@ -1175,31 +1175,31 @@ freeMem(encCurEmail); if (hasPassword) hPrintf("<div class=\"inputGroup\">" "<label for=\"curPassword\">Current password</label>" "<input type=\"password\" name=\"hgLogin_curPassword\" value=\"\" size=\"30\" id=\"curPassword\">" "</div>"); hPrintf("<div class=\"inputGroup\">" "<label for=\"newEmail1\">New email address</label>" "<input type=\"text\" name=\"hgLogin_newEmail1\" value=\"\" size=\"30\" id=\"newEmail1\">" "</div>"); hPrintf("<div class=\"inputGroup\">" "<label for=\"newEmail2\">Re-enter new email address</label>" "<input type=\"text\" name=\"hgLogin_newEmail2\" value=\"\" size=\"30\" id=\"newEmail2\">" "</div>"); hPrintf("<div class=\"formControls\">" - "<input type=\"submit\" name=\"hgLogin.do.changeEmail\" value=\"Change Email\" class=\"largeButton\">" + "<input type=\"submit\" name=\"hgLogin.do.changeEmail\" value=\"Change email\" class=\"largeButton\">" " <a href=\"%s\" class=\"cancelButton\">Cancel</a>" "</div></form></div><!-- END - changeEmailBox -->", getReturnToUrlForAttr()); cartSaveSession(cart); } void changeEmail(struct sqlConnection *conn) /* Process the change-email form for the currently logged-in user. */ { if (!emailLinkEnabled()) { displayLoginPage(conn); return; } char *user = wikiLinkUserName(); if (isEmpty(user)) @@ -1327,67 +1327,67 @@ "<form method=\"post\" action=\"%s\" name=\"mainForm\">" "<span style='color:red;'>%s</span>" "\n", hgLoginUrl, errMsg ? errMsg : ""); printUsernameNote(); hPrintf("<div class=\"inputGroup\">" "<label for=\"userName\">Username</label>" "<input type=text name=\"hgLogin_userName\" value=\"%s\" size=\"30\" id=\"userName\">" "</div>" "\n" "<div class=\"inputGroup\">" "<label for=\"emailAddr\">Email address</label>" "<input type=text name=\"hgLogin_email\" value=\"%s\" size=\"30\" id=\"emailAddr\">" "</div>" "\n" "<div class=\"inputGroup\">" - "<label for=\"reenterEmail\">Re-enter Email address</label>" + "<label for=\"reenterEmail\">Re-enter email address</label>" "<input type=text name=\"hgLogin_email2\" value=\"%s\" size=\"30\" id=\"emailCheck\">" "</div>\n", htmlEncode(cartUsualString(cart, "hgLogin_userName", "")), // all three go into value="" attributes; escape (XSS) htmlEncode(cartUsualString(cart, "hgLogin_email", "")), htmlEncode(cartUsualString(cart, "hgLogin_email2", ""))); if (sqlFieldIndex(conn, "gbMembers", "recovEmail") != -1) hPrintf("<div class=\"inputGroup\">" - "<label for=\"recovEmail\">Optional Secondary Recovery Email</label>" + "<label for=\"recovEmail\">Optional secondary recovery email</label>" "<input type=text name=\"hgLogin_recovEmail\" size=\"30\" id=\"recovEmail\">" "</div>" "\n"); hPrintf("<div class=\"inputGroup\">" "<label for=\"password\">Password <small>(must be at least 5 characters)</small></label>" "<span style=\"display:inline-flex; align-items:center;\">" "<input type=password name=\"hgLogin_password\" value=\"%s\" size=\"30\" id=\"password\">", htmlEncode(cartUsualString(cart, "hgLogin_password", ""))); // value="" attribute; escape (XSS) printPwdEyeIcon("signupPwEyeIcon", "signupPwEyeSlash"); hPrintf( "</span>" "</div>" "\n" "<div class=\"inputGroup\">" - "<label for=\"passwordCheck\">Re-enter Password</label>" + "<label for=\"passwordCheck\">Re-enter password</label>" "<span style=\"display:inline-flex; align-items:center;\">" "<input type=password name=\"hgLogin_password2\" value=\"%s\" size=\"30\" id=\"passwordCheck\">", htmlEncode(cartUsualString(cart, "hgLogin_password2", ""))); // value="" attribute; escape (XSS) printPwdEyeIcon("signupPwCheckEyeIcon", "signupPwCheckEyeSlash"); hPrintf( "</span>" "\n" "</div>" "\n" "<div class=\"formControls\">" - " <input type=\"submit\" name=\"hgLogin.do.signup\" value=\"Sign Up using Email\" class=\"largeButton\"> " + " <input type=\"submit\" name=\"hgLogin.do.signup\" value=\"Sign up using email\" class=\"largeButton\"> " " <a href=\"%s\" class=\"cancelButton\">Cancel</a>" "</div>" "</form>" "</div><!-- END - signUpBox -->", getReturnToUrlForAttr()); if (pwdEyeIconEnabled) { printPwdToggleJS(); jsOnEventById("click", "signupPwEyeIcon", "togglePwdVisibility('password','signupPwEyeSlash');"); jsOnEventById("click", "signupPwCheckEyeIcon", "togglePwdVisibility('passwordCheck','signupPwCheckEyeSlash');"); } cartSaveSession(cart); } void signup(struct sqlConnection *conn) @@ -1996,31 +1996,31 @@ hPrintf("<p>You signed in with %s. Pick a username for your new %s account. " "You can change the suggested name below.</p>", oauthProviderLabel(provider), brwName); printUsernameNote(); hPrintf("<span style='color:red;'>%s</span>", errMsg ? errMsg : ""); hPrintf("<form method=\"post\" action=\"%s\" name=\"completeAccountForm\">", hgLoginUrl); hPrintf("<div class=\"inputGroup\">" "<label for=\"userName\">Username</label>" "<input type=\"text\" name=\"hgLogin_userName\" value=\"%s\" size=\"30\" id=\"userName\">" "</div>", encSuggested); hPrintf("<div class=\"inputGroup\">" "<label for=\"emailAddr\">Email address</label>" "<input type=\"text\" name=\"hgLogin_email\" value=\"%s\" size=\"30\" id=\"emailAddr\">" "</div>", encEmail); hPrintf("<div class=\"formControls\">" - "<input type=\"submit\" name=\"hgLogin.do.completeAccount\" value=\"Create Account\" class=\"largeButton\">" + "<input type=\"submit\" name=\"hgLogin.do.completeAccount\" value=\"Create account\" class=\"largeButton\">" " <a href=\"%s\" class=\"cancelButton\">Cancel</a>" "</div></form></div><!-- END - completeAccountBox -->", getReturnToUrlForAttr()); cartSaveSession(cart); freeMem(encSuggested); freeMem(encEmail); } void completeAccount(struct sqlConnection *conn) /* Create the account for a first-time social-login user, link the identity, and log in. */ { char *provider = cartUsualString(cart, "oauth_pending_provider", ""); char *subject = cartUsualString(cart, "oauth_pending_subject", ""); if (isEmpty(provider) || isEmpty(subject) || !pendingIdentityValid()) { clearPendingIdentity(); @@ -2162,31 +2162,31 @@ hPrintf("<form method=\"post\" action=\"%s\" name=\"chooseAccountForm\">", hgLoginUrl); hPrintf("<div class=\"inputGroup\">"); boolean first = TRUE; for (m = list; m != NULL; m = m->next) { char *encUserName = htmlEncode(m->userName); hPrintf("<div class=\"acctHelpSection\">" "<input name=\"hgLogin_chosenIdx\" type=\"radio\" value=\"%u\" id=\"acct_%u\"%s>" "<label for=\"acct_%u\" class=\"radioLabel\">%s</label></div>", m->idx, m->idx, first ? " checked" : "", m->idx, encUserName); freeMem(encUserName); first = FALSE; } hPrintf("</div>"); hPrintf("<div class=\"formControls\">" - "<input type=\"submit\" name=\"hgLogin.do.chooseAccount\" value=\"Sign In\" class=\"largeButton\">" + "<input type=\"submit\" name=\"hgLogin.do.chooseAccount\" value=\"Sign in\" class=\"largeButton\">" " <a href=\"%s\" class=\"cancelButton\">Cancel</a>" "</div></form></div><!-- END - chooseAccountBox -->", getReturnToUrlForAttr()); cartSaveSession(cart); freeMem(encEmail); gbMembersFreeList(&list); } void chooseAccount(struct sqlConnection *conn) /* Finish the "which account?" chooser: for OAuth, link the pending identity to the chosen * account; for the email link, just sign in. Either way, only accept an account that really * matches the verified email (and, for the email link, still holds the valid token), never an * arbitrary username the client might submit. */ { int chosenIdx = cartUsualInt(cart, "hgLogin_chosenIdx", 0); char *provider = cartUsualString(cart, "oauth_pending_provider", "");