e60a259af2f05ba4da77086e3788b70097135bb8 chinhli Thu Apr 26 15:31:02 2012 -0700 Finished Account Help UI. diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c index 5d23199..fd05cfb 100644 --- src/hg/hgLogin/hgLogin.c +++ src/hg/hgLogin/hgLogin.c @@ -569,94 +569,31 @@ "<label for=\"password\">Re-enter Password</label>" "<input type=password name=\"hgLogin_password2\" value=\"%s\" size=\"30\" id=\"passwordCheck\">" "\n" "</div>" "\n" "<div class=\"formControls\">" " <input type=\"submit\" name=\"hgLogin.do.signup\" value=\"Sign Up\" class=\"largeButton\"> " " <a href=\"javascript:history.go(-1)\">Cancel</a>" "</div>" "</form>" "</div><!-- END - signUpBox -->" "\n" , cartUsualString(cart, "hgLogin_password", "") , cartUsualString(cart, "hgLogin_password2", "") ); -/******************************* old UI to be removed -hPrintf( -"<div id=\"hgLoginSignupBox\" class=\"centeredContainer\">\n" -"<h2>UCSC Genome Browser</h2>" -"\n" -); - -printf( -"<P>" -"Signing in enables you to save current settings into a " -"named session, and then restore settings from the session later.<BR> " -"If you wish, you can share named sessions with other users. " -"</P>" -); - -hPrintf( -"If you are already a member, click <a href=\"hgLogin?hgLogin.do.displayLoginPage=1\">here</a> to log in to UCSC Genome Browser.<br>\n" -"To change your password, click <a href=\"hgLogin?hgLogin.do.changePasswordPage=1\">here</a>.<br>\n" -"Lost your password? Click <a href=\"hgLogin?hgLogin.do.lostPasswordPage=1\">here</a>.<br>\n" -); - -hPrintf( -"<h3>Sign Up</h3>" -"\n" -"<form method=post action=\"hgLogin\" name=mainForm >" -"<span style='color:red;'>%s</span>" -, errMsg ? errMsg : "" -); - -hPrintf( -"<label style=\"display: block; margin-top: 10px;\" " -" for=\"userName\">User Name</label>" -"\n" -"<input type=text name=\"hgLogin_user\" value=\"%s\" size=\"30\" id=\"userName\"> <br>" -"\n" -"<label style=\"display: block; margin-top: 10px;\" " -" for=\"emailAddr\">E-mail</label>" -"\n" -"<input type=text name=\"hgLogin_email\" value=\"%s\" size=\"30\" id=\"emailAddr\"> <br>" -"\n" -"<label style=\"display: block; margin-top: 10px;\" " -" for=\"password\">Password</label>" -"\n" -"<input type=password name=\"hgLogin_password\" value=\"%s\" size=\"30\" id=\"password\">" -"\n" -"<label style=\"display: block; margin-top: 10px;\" " -" for=\"password2\">Confirm Password</label>" -"\n" -"<input type=password name=\"hgLogin_password2\" value=\"%s\" size=\"30\" id=\"password2\">" -"\n" -"<label style=\"display: block; margin-top: 10px;\" " -" for=\"realName\">Real Name (optional)</label>" -"\n" -"<input type=text name=\"hgLogin_realName\" value=\"%s\" size=\"30\" id=\"realName\"> <br>" -"\n" - - - -"<p>" -"<tr><td> </td><td><input type=submit name=hgLogin.do.signup value=submit>" -" <input type=button value=cancel ONCLICK=\"history.go(-1)\"></td></tr>\n" -"<br>\n" -"</p>" -****************************** to be removed ****************/ +// TODO: group them to one remove function // , cartUsualString(cart, "hgLogin_userName", "") // , cartUsualString(cart, "hgLogin_email", "") // , cartUsualString(cart, "hgLogin_email2", "") // , cartUsualString(cart, "hgLogin_password", "") // , cartUsualString(cart, "hgLogin_password2", "") // ); // cartSaveSession(cart); hPrintf("</FORM>"); } @@ -744,30 +681,66 @@ sqlUpdate(conn, query); hPrintf( "<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 */ +{ + +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" +"<div class=\"inputGroup\">" +"<div class=\"acctHelpSection\"><input name=\"helpWith\" type=\"radio\" value=\"password\" id=\"password\">" +"<label for=\"password\" class=\"radioLabel\">I forgot my <b>username</b>. Please email it to me.</label></div>" +"<div class=\"acctHelpSection\"><input name=\"helpWith\" type=\"radio\" value=\"username\" id=\"userName\">" +"<label for=\"userName\" class=\"radioLabel\">I forgot my <b>password</b>. Send me a new one.</label></div>" +"\n" +"</div>" +"\n" +); +hPrintf( +"<div class=\"inputGroup\">" +"<label for=\"emailPassword\">Email address</label>" +"<input type=\"text\" name=\"hgLogin_email\" size=\"30\" id=\"emailPassword\">" +"</div>" +"\n" +"<div class=\"formControls\">" +" <input type=\"submit\" name=\"hgLogin.do.displayLogin\" value=\"Continue\" class=\"largeButton\">" +" <a href=\"javascript:history.go(-1)\">Cancel</a>" +"</div>" +"</form>" +"</div><!-- END - accountHelpBox -->" +); +} /* ----- account login/display functions ---- */ void displayLoginPage(struct sqlConnection *conn) /* draw the account login page */ { char *username = cartUsualString(cart, "hgLogin_userName", ""); /* for password security, use cgi hash instead of cart */ // char *password = cgiUsualString("hgLogin_password", ""); hPrintf( "<div id=\"loginBox\" class=\"centeredContainer formBox\">" "\n" @@ -788,31 +761,31 @@ "</div>" "\n" "<div class=\"inputGroup\">" "<label for=\"password\">Password</label>" "<input type=password name=\"hgLogin_password\" value=\"\" size=\"30\" id=\"password\">" "</div>" "\n" "<div class=\"formControls\">" " <input type=\"submit\" name=\"hgLogin.do.displayLogin\" value=\"Login\" class=\"largeButton\">" " <a href=\"javascript:history.go(-1)\">Cancel</a>" "</div>" "</form>" "\n" "\n" "<div id=\"helpBox\">" -"<a href=\"accounthelp.html\">Can't access your account?</a><br>" +"<a href=\"hgLogin?hgLogin.do.displayAccHelpPage=1\">Can't access your account?</a><br>" "Need an account? <a href=\"hgLogin?hgLogin.do.signupPage=1\">Sign up</a>.<br>" "To change password, click <a href=\"hgLogin?hgLogin.do.changePasswordPage=1\">here</a>." "</div><!-- END - helpBox -->" "</div><!-- END - loginBox -->" "\n" "\n" "</body>" "</html>" , username ); cartSaveSession(cart); } @@ -1079,30 +1052,32 @@ "</p>" "<h3>Successfully updated the authentication file.</h3>" "Click <a href=hgLogin?hgLogin.do.signupPage=1>here</a> to return.<br>" ); } else if (cartVarExists(cart, "hgLogin.do.lostPasswordPage")) lostPasswordPage(conn); else if (cartVarExists(cart, "hgLogin.do.lostPassword")) lostPassword(conn); else if (cartVarExists(cart, "hgLogin.do.changePasswordPage")) changePasswordPage(conn); else if (cartVarExists(cart, "hgLogin.do.changePassword")) changePassword(conn); else if (cartVarExists(cart, "hgLogin.do.displayUserInfo")) displayUserInfo(conn); +else if (cartVarExists(cart, "hgLogin.do.displayAccHelpPage")) + displayAccHelpPage(conn); else if (cartVarExists(cart, "hgLogin.do.displayLoginPage")) displayLoginPage(conn); else if (cartVarExists(cart, "hgLogin.do.displayLogin")) displayLogin(conn); else if (cartVarExists(cart, "hgLogin.do.displayLogout")) displayLogoutSuccess(); else if (cartVarExists(cart, "hgLogin.do.signup")) signup(conn); else signupPage(conn); hDisconnectCentral(&conn); cartRemovePrefix(cart, "hgLogin.do.");