0ad3c86f3b7b236957e808c47fe26bd4b6729720
chinhli
Fri Sep 28 14:08:53 2012 -0700
Bug #9151 Missing username information in hgLogin forgot password confirmation message.
diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c
index 73aba68..f4ee624 100644
--- src/hg/hgLogin/hgLogin.c
+++ src/hg/hgLogin/hgLogin.c
@@ -399,30 +399,49 @@
"
"
+ "
%s
", brwName);
+hPrintf(
+ "
An email containing password reset information has been sent to registered email address of %s.
"
+ " If you do not receive an email, please contact genome-www@soe.ucsc.edu for help.
", username);
+hPrintf(
+ "
Return to Login
");
+cartRemove(cart, "hgLogin_helpWith");
+cartRemove(cart, "hgLogin_email");
+cartRemove(cart, "hgLogin_userName");
+cartRemove(cart, "hgLogin_sendMailTo");
+cartRemove(cart, "hgLogin_sendMailContain");
+}
+
void sendMailOut(char *email, char *subject, char *msg)
/* send mail to email address */
{
char *hgLoginHost = wikiLinkHost();
char *obj = cartUsualString(cart, "hgLogin_helpWith", "");
int result;
result = mailItOut(email, subject, msg, returnAddr);
if (result == -1)
{
hPrintf(
"
%s
", brwName);
hPrintf(
"
"
"
"
"
Error emailing %s to: %s
"
@@ -466,42 +485,71 @@
safef(query,sizeof(query),"SELECT * FROM gbMembers WHERE email='%s'", email);
sr = sqlGetResult(conn, query);
int numUser = 0;
while ((row = sqlNextRow(sr)) != NULL)
{
struct gbMembers *m = gbMembersLoad(row);
if (numUser >= 1)
safecat(userList, sizeof(userList), ", ");
safecat(userList, sizeof(userList), m->userName);
numUser += 1;
}
sqlFreeResult(&sr);
mailUsername(email, userList);
}
+void sendPwdMailOut(char *email, char *subject, char *msg, char *username)
+/* send password reset mail to user at registered email address */
+{
+char *hgLoginHost = wikiLinkHost();
+char *obj = cartUsualString(cart, "hgLogin_helpWith", "");
+int result;
+result = mailItOut(email, subject, msg, returnAddr);
+if (result == -1)
+ {
+ hPrintf(
+ "
%s
", brwName);
+ hPrintf(
+ "
"
+ "
"
+ "
Error emailing %s to: %s
"
+ "Click
here to return.
",
+ obj, email );
+ }
+else
+ {
+ hPrintf("", hgLoginHost, username);
+ }
+}
+
void sendNewPwdMail(char *username, char *email, char *password)
/* send user new password */
{
char subject[256];
char msg[4096];
char *remoteAddr=getenv("REMOTE_ADDR");
safef(subject, sizeof(subject),"New temporary password for %s", brwName);
safef(msg, sizeof(msg),
" Someone (probably you, from IP address %s) requested a new password for %s (%s). A temporary password for user \"%s\" has been created and was set to \"%s\". If this was your intent, you will need to log in and choose a new password now. Your temporary password will expire in 7 days.\n\n If someone else made this request, or if you have remembered your password, and you no longer wish to change it, you may ignore this message and continue using your old password.\n\n%s\n%s",
remoteAddr, brwName, brwAddr, username, password, signature, returnAddr);
-sendMailOut(email, subject, msg);
+sendPwdMailOut(email, subject, msg, username);
}
void displayAccHelpPage(struct sqlConnection *conn)
/* draw the account help page */
{
char *email = cartUsualString(cart, "hgLogin_email", "");
char *username = cartUsualString(cart, "hgLogin_userName", "");
hPrintf("