fd0b25bc78b9419bf7f4ed8d9f854f85831344d6
chinhli
Mon Apr 9 11:27:46 2012 -0700
fixed signup UI
diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c
index 3c09d3a..6c0bdbe 100644
--- src/hg/hgLogin/hgLogin.c
+++ src/hg/hgLogin/hgLogin.c
@@ -15,31 +15,31 @@
#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 };
+char *excludeVars[] = { "submit", "Submit", "debug", "fixMembers", "update", "hgLogin_password","hgLogin_confirmPWD", 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 */
/* -------- password functions ---- */
void encryptPWD(char *password, char *salt, char *buf, int bufsize)
/* encrypt a password */
{
/* encrypt user's password. */
@@ -432,88 +432,88 @@
"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"
-"");
}
void signup(struct sqlConnection *conn)
/* process the signup form */
{
char query[256];
char *user = cartUsualString(cart, "hgLogin_user", "");
@@ -568,51 +568,69 @@
char encPwd[35] = "";
encryptNewPwd(password, encPwd, sizeof(encPwd));
safef(query,sizeof(query), "insert into gbMembers set "
"userName='%s',realName='%s',password='%s',email='%s', "
"lastUse=NOW(),activated='N',dateAuthenticated='9999-12-31 23:59:59'",
sqlEscapeString(user),sqlEscapeString(realName),sqlEscapeString(encPwd),sqlEscapeString(email));
sqlUpdate(conn, query);
hPrintf(
"UCSC Genome Browser
\n"
"\n"
"
\n"
"User %s successfully added.
\n"
-, email
+, user
);
+backToHgSession(2);
+/*
+char *hgLoginHost = hgLoginLinkHost();
hPrintf(
-"Click here to return.
\n"
-);
+""
+,hgLoginHost);
+*/
+
+//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", "");
/* 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"
@@ -774,51 +792,72 @@
hPrintf(
"
UCSC Genome Browser Sign Out
"
"
"
"
"
"
"
"\n"
);
hPrintf(
"\n"
);
/* return to session */
-/*******************************/
+backToHgSession(1);
+/*******************************
hPrintf(
""
,hgLoginHost);
-/****************************/
+****************************/
}
+void backToHgSession(int nSec)
+/* delay for N micro seconds then go back to hgSession page */
+/* TODO: afterDelayBackTo("http....") */
+{
+char *hgLoginHost = hgLoginLinkHost();
+int delay=nSec*1000;
+hPrintf(
+""
+,delay
+,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,""))
{
freez(&errMsg);
errMsg = cloneString("User name cannot be blank.");
displayUserInfo(conn);
return;