e84a262e895aa2298240a1bbda398c92c86342d6 chinhli Thu May 3 10:42:19 2012 -0700 Finished require user id before send new password. diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c index 5275c27..bc69f1c 100644 --- src/hg/hgLogin/hgLogin.c +++ src/hg/hgLogin/hgLogin.c @@ -748,68 +748,92 @@ "<h2>UCSC Genome Browser</h2>\n" "<p align=\"left\">\n" "</p>\n" "<h3>User %s successfully added.</h3>\n" , user ); /* TODO: cleanup the hgLogin_xxxx vars in the cart */ backToHgSession(2); } void displayAccHelpPage(struct sqlConnection *conn) /* draw the account help page */ { char *email = cartUsualString(cart, "hgLogin_email", ""); +char *username = cartUsualString(cart, "hgLogin_email", ""); // cartRemove(cart, "hgLogin_helpWith"); //cartRemove(cart, "hgLogin_email"); hPrintf( +"<script language=\"JavaScript\">\n" +"<!-- " +"\n" +"function toggle(value){\n" +"if(value=='show')\n" +" document.getElementById('usernameBox').style.visibility='visible';\n" +"else\n" +" document.getElementById('usernameBox').style.visibility='hidden';\n" +"}\n" +"\n" +"//-->" +"\n" +"</script>" +"\n" +); +hPrintf( "<div id=\"accountHelpBox\" class=\"centeredContainer formBox\">" "\n" "<h2>UCSC Genome Browser</h2>" "\n" "<h3>Having trouble signing in?</h3>" "\n" "<form method=post action=\"hgLogin\" name=\"accountLoginForm\" id=\"acctHelpForm\">" "\n" "<p><span style='color:red;'>%s</span><p>" "\n" , errMsg ? errMsg : "" ); hPrintf( "<div class=\"inputGroup\">" -"<div class=\"acctHelpSection\"><input name=\"hgLogin_helpWith\" type=\"radio\" value=\"username\" id=\"username\" checked>" -"<label for=\"username\" class=\"radioLabel\">I forgot my <b>username</b>. Please email it to me.</label></div>" -"<div class=\"acctHelpSection\"><input name=\"hgLogin_helpWith\" type=\"radio\" value=\"password\" id=\"password\">" +"<div class=\"acctHelpSection\"><input name=\"hgLogin_helpWith\" type=\"radio\" value=\"password\" id=\"password\" checked=\"checked\" onclick=\"toggle('show');\">" "<label for=\"password\" class=\"radioLabel\">I forgot my <b>password</b>. Send me a new one.</label></div>" +"<div class=\"acctHelpSection\"><input name=\"hgLogin_helpWith\" type=\"radio\" value=\"username\" id=\"username\" onclick=\"toggle('hide');\">" +"<label for=\"username\" class=\"radioLabel\">I forgot my <b>username</b>. Please email it to me.</label></div>" "\n" "</div>" "\n" ); hPrintf( "<div class=\"inputGroup\">" "<label for=\"emailPassword\">Email address</label>" "<input type=\"text\" name=\"hgLogin_email\" value=\"%s\" size=\"30\" id=\"emailPassword\">" "</div>" "\n" +"<div class=\"inputGroup\" id=\"usernameBox\">" +"<label for=\"emailUsername\">Username</label>" +"<input type=\"text\" name=\"hgLogin_userName\" value=\"%s\" size=\"30\" id=\"emailUsername\">" +"</div>" +"\n" + "<div class=\"formControls\">" " <input type=\"submit\" name=\"hgLogin.do.accountHelp\" value=\"Continue\" class=\"largeButton\">" " <a href=\"javascript:history.go(-1)\">Cancel</a>" "</div>" "</form>" "</div><!-- END - accountHelpBox -->" , email +, username ); cartSaveSession(cart); } void accountHelp(struct sqlConnection *conn) /* email user username(s) or new password */ { // struct sqlResult *sr; // char **row; // char query[256]; char *email = cartUsualString(cart, "hgLogin_email", ""); char *helpWith = cartUsualString(cart, "hgLogin_helpWith", ""); if (sameString(email,"")) {