diff --git a/swad_account.c b/swad_account.c
index 701e2fc5d..6c636b05f 100644
--- a/swad_account.c
+++ b/swad_account.c
@@ -462,12 +462,17 @@ void Acc_ShowFormChangeMyAccount (void)
Acc_PrintAccountSeparator ();
/***** E-mail *****/
- if (IMustFillEmail || IShouldConfirmEmail)
+ if (IMustFillEmail || IShouldConfirmEmail ||
+ Gbl.Usrs.Me.ConfirmEmailJustSent)
{
fprintf (Gbl.F.Out,"
"
"");
- Lay_ShowAlert (Lay_WARNING,IMustFillEmail ? Txt_Please_fill_in_your_email_address :
- Txt_Please_check_and_confirm_your_email_address);
+ if (IMustFillEmail)
+ Lay_ShowAlert (Lay_WARNING,Txt_Please_fill_in_your_email_address);
+ else if (IShouldConfirmEmail)
+ Lay_ShowAlert (Lay_WARNING,Txt_Please_check_and_confirm_your_email_address);
+ else // Gbl.Usrs.Me.ConfirmEmailJustSent
+ Mai_ShowMsgConfirmEmailHasBeenSent ();
fprintf (Gbl.F.Out," | "
"
");
}
diff --git a/swad_changelog.h b/swad_changelog.h
index 1b6ef0f83..5699952ca 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -148,13 +148,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.19 (2016-10-10)"
+#define Log_PLATFORM_VERSION "SWAD 16.19.1 (2016-10-10)"
#define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
+ Version 16.19.1: Oct 10, 2016 Message to report that confirmation e-mail has been sent. (? lines)
Version 16.19: Oct 10, 2016 Warning in User > Session to confirm user's e-mail address.
Changes in form to edit user's account. (205194 lines)
Version 16.18.1: Oct 10, 2016 Warning in User > Account to confirm user's e-mail address. (205116 lines)
diff --git a/swad_mail.c b/swad_mail.c
index b84d12c25..32f67f5b9 100644
--- a/swad_mail.c
+++ b/swad_mail.c
@@ -1372,7 +1372,6 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
{
extern const char *Txt_The_email_address_X_matches_one_previously_registered;
extern const char *Txt_The_email_address_X_has_been_registered_successfully;
- extern const char *Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address;
extern const char *Txt_The_email_address_X_had_been_registered_by_another_user;
extern const char *Txt_The_email_address_entered_X_is_not_valid;
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
@@ -1409,11 +1408,7 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
to confirm the new email address *****/
if (ItsMe)
if (Mai_SendMailMsgToConfirmEmail ())
- {
- sprintf (Gbl.Message,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
- Gbl.Usrs.Me.UsrDat.Email);
- Lay_ShowAlert (Lay_INFO,Gbl.Message);
- }
+ Mai_ShowMsgConfirmEmailHasBeenSent ();
}
else
{
@@ -1545,7 +1540,6 @@ bool Mai_SendMailMsgToConfirmEmail (void)
ReturnCode = system (Command);
if (ReturnCode == -1)
Lay_ShowErrorAndExit ("Error when running script to send e-mail.");
- Gbl.Usrs.Me.ConfirmEmailJustSent = true;
/***** Remove temporary file *****/
unlink (Gbl.Msg.FileNameMail);
@@ -1555,6 +1549,7 @@ bool Mai_SendMailMsgToConfirmEmail (void)
switch (ReturnCode)
{
case 0: // Message sent successfully
+ Gbl.Usrs.Me.ConfirmEmailJustSent = true;
return true;
case 1:
Lay_ShowAlert (Lay_WARNING,Txt_There_was_a_problem_sending_an_email_automatically);
@@ -1569,14 +1564,27 @@ bool Mai_SendMailMsgToConfirmEmail (void)
}
/*****************************************************************************/
-/************************* Set my pending password ***************************/
+/******* Show alert to report that confirmation e-mail has been sent *********/
+/*****************************************************************************/
+
+void Mai_ShowMsgConfirmEmailHasBeenSent (void)
+ {
+ extern const char *Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address;
+
+ sprintf (Gbl.Message,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
+ Gbl.Usrs.Me.UsrDat.Email);
+ Lay_ShowAlert (Lay_INFO,Gbl.Message);
+ }
+
+/*****************************************************************************/
+/************************* Insert mail hey in database ***********************/
/*****************************************************************************/
static void Mai_InsertMailKey (const char *Email,const char MailKey[Mai_LENGTH_EMAIL_CONFIRM_KEY+1])
{
char Query[512+Mai_LENGTH_EMAIL_CONFIRM_KEY];
- /***** Remove expired pending passwords from database *****/
+ /***** Remove expired pending e-mails from database *****/
sprintf (Query,"DELETE FROM pending_emails"
" WHERE DateAndTime%s"
" para confirmar dicha dirección."; // Necessita traduccio
#elif L==2
"A message has been sent"
- " to e-mail address %s"
+ " to e-mail address %s"
" to confirm that address."; // Need Übersetzung
#elif L==3
"A message has been sent"
- " to e-mail address %s"
+ " to e-mail address %s"
" to confirm that address.";
#elif L==4
"Se ha enviado un mensaje"
- " a la dirección de correo %s"
+ " a la dirección de correo %s"
" para confirmar dicha dirección.";
#elif L==5
"A message has been sent"
- " to e-mail address %s"
+ " to e-mail address %s"
" to confirm that address."; // Besoin de traduction
#elif L==6
"Se ha enviado un mensaje"
- " a la dirección de correo %s"
+ " a la dirección de correo %s"
" para confirmar dicha dirección."; // Okoteve traducción
#elif L==7
"A message has been sent"
- " to e-mail address %s"
+ " to e-mail address %s"
" to confirm that address."; // Bisogno di traduzione
#elif L==8
"A message has been sent"
- " to e-mail address %s"
+ " to e-mail address %s"
" to confirm that address."; // Potrzebujesz tlumaczenie
#elif L==9
"A message has been sent"
- " to e-mail address %s"
+ " to e-mail address %s"
" to confirm that address."; // Necessita de tradução
#endif
@@ -42243,31 +42243,31 @@ const char *Txt_The_email_address_entered_X_is_not_valid = // Warning: it is ver
const char *Txt_The_email_address_X_had_been_registered_by_another_user = // Warning: it is very important to include %s in the following sentences
#if L==1
"La dirección de correo %s"
- " ya había sido registrada por otro usuario."; // Necessita traduccio
+ " ya ha sido registrada por otro usuario."; // Necessita traduccio
#elif L==2
"The e-mail address %s"
- " had been registered by another user."; // Need Übersetzung
+ " had been registered by another user."; // Need Übersetzung
#elif L==3
"The e-mail address %s"
" had been registered by another user.";
#elif L==4
"La dirección de correo %s"
- " ya había sido registrada por otro usuario.";
+ " ya ha sido registrada por otro usuario.";
#elif L==5
"The e-mail address %s"
- " had been enrolled by another user."; // Besoin de traduction
+ " had been enrolled by another user."; // Besoin de traduction
#elif L==6
"La dirección de correo %s"
- " ya había sido registrada por otro usuario."; // Okoteve traducción
+ " ya ha sido registrada por otro usuario."; // Okoteve traducción
#elif L==7
"Il e-mail %s"
" è stato registrato da un altro utente.";
#elif L==8
"The e-mail address %s"
- " had been registered by another user."; // Potrzebujesz tlumaczenie
+ " had been registered by another user."; // Potrzebujesz tlumaczenie
#elif L==9
"The e-mail address %s"
- " had been registered by another user."; // Necessita de tradução
+ " had been registered by another user."; // Necessita de tradução
#endif
const char *Txt_The_email_address_X_has_been_registered_successfully = // Warning: it is very important to include %s in the following sentences