97d15ef380b283340f7c236a5d24fed3156e8ff1 chinhli Sun Apr 8 10:27:43 2012 -0700 Finished signup UI. diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c index 636bc31..3c09d3a 100644 --- src/hg/hgLogin/hgLogin.c +++ src/hg/hgLogin/hgLogin.c @@ -8,30 +8,31 @@ #include "memalloc.h" #include "jksql.h" #include "htmshell.h" #include "cart.h" #include "hPrint.h" #include "hdb.h" #include "hui.h" #include "web.h" #include "ra.h" #include "hgColors.h" #include #include "net.h" #include "hgLogin.h" +#include "hgLoginLink.h" #include "gbMembers.h" #include "versionInfo.h" char msg[2048] = ""; char *excludeVars[] = { "submit", "Submit", "debug", "fixMembers", "update", "hgLogin_password", NULL }; /* The excludeVars are not saved to the cart. (We also exclude * any variables that start "near.do.") */ /* ---- Global variables. ---- */ 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 */ @@ -409,60 +410,111 @@ cartRemove(cart, "hgLogin_newPassword"); } void signupPage(struct sqlConnection *conn) /* draw the signup page */ /* XXXX TODO: cornfirm password, password help like Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only. optional real name */ { hPrintf( -"

UCSC Genome Browser

\n" -"

" -"

" -"GSID provides access to data from the 2003 VaxGen HIV vaccine phase III clinical trials on a yearly access-fee basis.
\n" -"Academic and non-profit researchers get a substantial discount.
\n" -"
\n" -"If you are already a member, click here to access UCSC Genome Browser.
\n" -"To view your existing account, click here.
\n" +"
\n" +"

UCSC Genome Browser

" +"\n" +); + +printf( +"

" +"Signing in enables you to save current settings into a " +"named session, and then restore settings from the session later.
" +"If you wish, you can share named sessions with other users. " +"

" +); + +hPrintf( +"If you are already a member, click here to log in to UCSC Genome Browser.
\n" "To change your password, click here.
\n" "Lost your password? Click here.
\n" +); + +hPrintf( +"

Sign Up

" +"\n" +"
" "%s" -"

Sign up

\n" -"\n" -"NOTE: Your e-mail is also your user-id.\n" -"\n" +, errMsg ? errMsg : "" +); + +hPrintf( +"" +"\n" +"
" +"\n" +"" +"\n" +"
" +"\n" +"" +"\n" +"" +"\n" +"" +"\n" +"" +"\n" +"" +"\n" +"
" +"\n" + + + +/******** "\n" "\n" "\n" "\n" -"
Name
E-mail\n" "
Password
Real name (optional)
 " " 
\n" "
\n" -, getenv("HTTP_HOST") -, errMsg ? errMsg : "" , cartUsualString(cart, "hgLogin_user", "") , cartUsualString(cart, "hgLogin_email", "") -, cartUsualString(cart, "hgLogin_password", "") +//, cartUsualString(cart, "hgLogin_password", "") , cartUsualString(cart, "hgLogin_realName", "") ); +****************/ +"

" +" " +" \n" +"
\n" +"

" +, cartUsualString(cart, "hgSignup_user", "") +, cartUsualString(cart, "hgSignup_email", "") +, cartUsualString(cart, "hgSignup_password", "") +, cartUsualString(cart, "hgSignup_confirmPWD", "") +, cartUsualString(cart, "hgSignup_realName", "") +); cartSaveSession(cart); hPrintf("
"); } void signup(struct sqlConnection *conn) /* process the signup form */ { char query[256]; char *user = cartUsualString(cart, "hgLogin_user", ""); if (!user || sameString(user,"")) @@ -534,81 +586,81 @@ hPrintf( "Click here to return.
\n" ); } /* ----- account login/display functions ---- */ void displayLoginPage(struct sqlConnection *conn) /* draw the account login page */ { -// char *username = cartUsualString(cart, "hgLogin_userName", ""); +char *username = cartUsualString(cart, "hgLogin_userName", ""); /* for password security, use cgi hash instead of cart */ // char *password = cgiUsualString("hgLogin_password", ""); hPrintf( "
\n" "

UCSC Genome Browser

" "\n" ); printf( "

" "Signing in enables you to save current settings into a " "named session, and then restore settings from the session later.
" "If you wish, you can share named sessions with other users. " "

" ); hPrintf( "%s" , errMsg ? errMsg : "" ); hPrintf( "

Login

" "\n" "
" "\n"); hPrintf( "" "\n" -"
" +"
" "\n" "" "\n" "" "\n" "

" "Forgot your password?
" "Need an account?" "

" "\n" "

" "" "\n" // " Cancel" " " "

" "\n" "
" "
" -//, username +, username //, password ); cartSaveSession(cart); hPrintf(""); } /******* BEGIN dispalyLogin *************************/ void displayLogin(struct sqlConnection *conn) /* display user account info */ { struct sqlResult *sr;