d072119705aa4c302f23241ba540bde253a373ac
chinhli
Fri Apr 27 15:10:00 2012 -0700
Finish initial mail out function with accountHelp form.
diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c
index fd05cfb..c706c62 100644
--- src/hg/hgLogin/hgLogin.c
+++ src/hg/hgLogin/hgLogin.c
@@ -27,30 +27,65 @@
char msg[2048] = "";
char *excludeVars[] = { "submit", "Submit", "debug", "fixMembers", "update",
"hgLogin_password", "hgLogin_password2", "hgLogin_newPassword1",
"hgLogin_newPassword2", 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 */
+/* -------- utilities functions --- */
+
+void sendMail()
+{
+char cmd[256];
+char email[256]="chinhli@soe.ucsc.edu";
+char msg[256]="UCSC";
+safef(cmd,sizeof(cmd),
+"echo 'Hello from your favoriate browser at: %s' | mail -s \"Greeting form UCSC Genome Browser\" %s"
+, msg, email);
+int result = system(cmd);
+if (result == -1)
+ {
+ hPrintf(
+ "
"
"\n"
"
UCSC Genome Browser
"
@@ -829,35 +906,32 @@
sqlFreeResult(&sr);
/* TODO: check user name exist and activated */
/* ..... */
if (checkPwd(password,m->password))
{
unsigned int userID=m->idx;
hPrintf("
Login successful for user %s with id %d.\n
\n"
,userName,userID);
displayLoginSuccess(userName,userID);
return;
}
else
{
- //hPrintf("
Invalid User/Password
\n");
- errMsg = cloneString("Invalid User/Password.");
-
+ errMsg = cloneString("Invalid user name or password.");
displayLoginPage(conn);
- // hPrintf("Return to
signup.
\n");
return;
}
gbMembersFree(&m);
}
/******* END dispalyLogin *************************/
void displayLoginSuccess(char *userName, int userID)
/* display login success msg, and set cookie */
{
// char *hgLoginHost = hgLoginLinkHost();
hPrintf(
"
UCSC Genome Browser
"
@@ -1042,42 +1116,50 @@
"Click
here to return.
"
);
}
*/
else if (cartVarExists(cart, "update"))
{
updatePasswordsFile(conn);
hPrintf(
"
UCSC Genome Browser
"
"
"
"
"
"
Successfully updated the authentication file.
"
"Click
here to return.
"
);
}
+/*******************************************************************
+else if (cartVarExists(cart, "hgLogin.do.lostUserNamePage"))
+ lostUserNamedPage(conn);
+else if (cartVarExists(cart, "hgLogin.do.lostUserName"))
+ lostUserName(conn);
+********************************************************************/
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.accountHelp"))
+ accountHelp(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.");