716acb7dabc447ddf157ec96ad615a195b4df3d2 chinhli Fri Apr 6 15:59:16 2012 -0700 Finished hgLogin UI diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c index 57568f9..636bc31 100644 --- src/hg/hgLogin/hgLogin.c +++ src/hg/hgLogin/hgLogin.c @@ -534,53 +534,82 @@ 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", ""); +// 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" "
" -"" -"
" -"
User Name
" -"
Password
" -"

Forgot your password? Need an account?

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

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

" +"\n" +"

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

" -"
" -, errMsg ? errMsg : "" -, username -, password +"

" +"\n" +"
" +"
" +//, username +//, password ); cartSaveSession(cart); hPrintf(""); } /******* BEGIN dispalyLogin *************************/ void displayLogin(struct sqlConnection *conn) /* display user account info */ { struct sqlResult *sr; char **row; @@ -614,123 +643,125 @@ displayLoginPage(conn); return; } struct gbMembers *m = gbMembersLoad(row); sqlFreeResult(&sr); /* TODO: check user name exist and activated */ /* ..... */ if (checkPwd(password,m->password)) { hPrintf("

Login succesful !!!! calling displayLoginSuccess now.

\n"); unsigned int userID=m->idx; hPrintf("Before call userID is %d\n",userID); displayLoginSuccess(userName,userID); -// htmlSetCookie("hgLogin_User", "chinhli", NULL, NULL, ".cse.ucsc.edu", FALSE); -// hPrintf(""); return; } else { hPrintf("

Invalid User/Password

\n"); hPrintf("Return to signup.
\n"); } gbMembersFree(&m); } /******* end old dispalyLogin *************************/ void displayLoginSuccess(char *userName, int userID) /* display login success msg, and set cookie */ { +char *hgLoginHost = hgLoginLinkHost(); + hPrintf( "

UCSC Genome Browser

" "

" "

" "" "\n" ); hPrintf( "\n" "" "\n", userID, userName,userID); hPrintf( "" -); +,hgLoginHost); } void displayLogoutSuccess() /* display logout success msg, and reset cookie */ { +char *hgLoginHost = hgLoginLinkHost(); + hPrintf( "

UCSC Genome Browser Sign Out

" "

" "

" "" "\n" ); hPrintf( "\n" ); /* return to session */ /*******************************/ hPrintf( "" -); +,hgLoginHost); /****************************/ } void displayUserInfo(struct sqlConnection *conn) /* display user account info */ { struct sqlResult *sr; char **row; char query[256]; char *user = cartUsualString(cart, "hgLogin_user", ""); /*************************************/ if (sameString(user,""))