Version 18.41.5

This commit is contained in:
Antonio Cañas Vargas 2019-02-14 13:22:11 +01:00
parent dc048f0c5e
commit 05e9e6464f
6 changed files with 102 additions and 79 deletions

View File

@ -384,10 +384,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 18.41.4 (2019-02-14)" #define Log_PLATFORM_VERSION "SWAD 18.41.5 (2019-02-14)"
#define CSS_FILE "swad18.41.1.css" #define CSS_FILE "swad18.41.1.css"
#define JS_FILE "swad18.32.1.js" #define JS_FILE "swad18.32.1.js"
/* /*
Version 18.41.5: Feb 14, 2019 Changes in welcome alert. (239256 lines)
Version 18.41.4: Feb 14, 2019 By default, timeline now shows all users. (239229 lines) Version 18.41.4: Feb 14, 2019 By default, timeline now shows all users. (239229 lines)
Version 18.41.3: Feb 14, 2019 Chat is temporarily disabled because modern browsers don't allow Java. (239228 lines) Version 18.41.3: Feb 14, 2019 Chat is temporarily disabled because modern browsers don't allow Java. (239228 lines)
Version 18.41.2: Feb 14, 2019 Change in layout of attendance list. Version 18.41.2: Feb 14, 2019 Change in layout of attendance list.

View File

@ -3205,7 +3205,7 @@ const char *Hlp_PROFILE_Account =
#elif L==9 #elif L==9
"PROFILE.Account.en"; "PROFILE.Account.en";
#endif #endif
/*
const char *Hlp_PROFILE_Account_email = const char *Hlp_PROFILE_Account_email =
#if L==1 #if L==1
"PROFILE.Account.es#correo"; "PROFILE.Account.es#correo";
@ -3226,7 +3226,7 @@ const char *Hlp_PROFILE_Account_email =
#elif L==9 #elif L==9
"PROFILE.Account.en#email"; "PROFILE.Account.en#email";
#endif #endif
*/
const char *Hlp_PROFILE_Session_role = const char *Hlp_PROFILE_Session_role =
#if L==1 #if L==1
"PROFILE.Session.es#rol"; "PROFILE.Session.es#rol";

View File

@ -1658,26 +1658,6 @@ bool Mai_UpdateEmailInDB (const struct UsrData *UsrDat,const char NewEmail[Cns_M
return true; // Successfully updated return true; // Successfully updated
} }
/*****************************************************************************/
/********** Put button to go to check and confirm my email address ***********/
/*****************************************************************************/
void Mai_PutButtonToCheckEmailAddress (void)
{
extern const char *Hlp_PROFILE_Account_email;
extern const char *Txt_Email_unconfirmed;
extern const char *Txt_Please_confirm_your_email_address;
extern const char *Txt_Check;
/***** Box with button to check email address *****/
Box_StartBox (NULL,Txt_Email_unconfirmed,NULL,
Hlp_PROFILE_Account_email,Box_CLOSABLE);
Ale_ShowAlertAndButton (Ale_WARNING,Txt_Please_confirm_your_email_address,
ActFrmMyAcc,NULL,NULL,NULL,
Btn_CONFIRM_BUTTON,Txt_Check);
Box_EndBox ();
}
/*****************************************************************************/ /*****************************************************************************/
/************** Send mail message to confirm my email address ****************/ /************** Send mail message to confirm my email address ****************/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -86,7 +86,6 @@ void May_NewMyUsrEmail (void);
void Mai_NewOtherUsrEmail (void); void Mai_NewOtherUsrEmail (void);
bool Mai_UpdateEmailInDB (const struct UsrData *UsrDat,const char NewEmail[Cns_MAX_BYTES_EMAIL_ADDRESS + 1]); bool Mai_UpdateEmailInDB (const struct UsrData *UsrDat,const char NewEmail[Cns_MAX_BYTES_EMAIL_ADDRESS + 1]);
void Mai_PutButtonToCheckEmailAddress (void);
bool Mai_SendMailMsgToConfirmEmail (void); bool Mai_SendMailMsgToConfirmEmail (void);
void Mai_ConfirmEmail (void); void Mai_ConfirmEmail (void);

View File

@ -10340,7 +10340,7 @@ const char *Txt_Email_X_removed = // Warning: it is very important to include %s
#elif L==9 // pt #elif L==9 // pt
"Email <strong>%s</strong> removido."; "Email <strong>%s</strong> removido.";
#endif #endif
/*
const char *Txt_Email_unconfirmed = const char *Txt_Email_unconfirmed =
#if L==1 // ca #if L==1 // ca
"Correo no confirmado"; // Necessita traduccio "Correo no confirmado"; // Necessita traduccio
@ -10361,7 +10361,7 @@ const char *Txt_Email_unconfirmed =
#elif L==9 // pt #elif L==9 // pt
"Email n&atilde;o confirmado"; "Email n&atilde;o confirmado";
#endif #endif
*/
const char *Txt_End_date = const char *Txt_End_date =
#if L==1 // ca #if L==1 // ca
"Data final"; "Data final";
@ -28938,11 +28938,32 @@ const char *Txt_Play = // To play a game
"Jogar"; "Jogar";
#endif #endif
const char *Txt_Please_check_your_email_address =
#if L==1 // ca
"Si us plau, comproveu la seva adre&ccedil;a de correu.";
#elif L==2 // de
"Bitte &uuml;berpr&uuml;fen Ihre E-Mail-Adresse.";
#elif L==3 // en
"Please check your email address.";
#elif L==4 // es
"Por favor, compruebe su direcci&oacute;n de correo.";
#elif L==5 // fr
"S'il vous pla&iacute;t, v&eaxcute;rifiez votre adresse email.";
#elif L==6 // gn
"Por favor, compruebe su direcci&oacute;n de correo."; // Okoteve traducción
#elif L==7 // it
"Per favore, verifica il tuo indirizzo email.";
#elif L==8 // pl
"Prosz&eogon; sprawd&zacute; sw&oacute;j adres email.";
#elif L==9 // pt
"Por favor, verifique seu endere&ccedil;o de email.";
#endif
const char *Txt_Please_confirm_your_email_address = const char *Txt_Please_confirm_your_email_address =
#if L==1 // ca #if L==1 // ca
"Si us plau, confirmeu la seva adre&ccedil;a de correu."; "Si us plau, confirmeu la seva adre&ccedil;a de correu.";
#elif L==2 // de #elif L==2 // de
"Bitte Ihre E-Mail-Adresse best&auml;tigen."; "Bitte best&auml;tige Ihre E-Mail-Adressen.";
#elif L==3 // en #elif L==3 // en
"Please confirm your email address."; "Please confirm your email address.";
#elif L==4 // es #elif L==4 // es
@ -28956,7 +28977,7 @@ const char *Txt_Please_confirm_your_email_address =
#elif L==8 // pl #elif L==8 // pl
"Prosz&eogon; potwierdzi&cacute; sw&oacute;j adres email."; "Prosz&eogon; potwierdzi&cacute; sw&oacute;j adres email.";
#elif L==9 // pt #elif L==9 // pt
"Por favor, confirmar o seu endere&ccedil;o de email."; "Por favor, confirme seu endere&ccedil;o de email.";
#endif #endif
const char *Txt_Please_enter_your_ID = const char *Txt_Please_enter_your_ID =
@ -52942,86 +52963,86 @@ const char *Txt_Welcome_X[Usr_NUM_SEXS] = // Warning: it is very important to in
#endif #endif
}; };
const char *Txt_Welcome_X_and_happy_birthday[Usr_NUM_SEXS] = // Warning: it is very important to include %s in the following sentences const char *Txt_Welcome_X_happy_birthday[Usr_NUM_SEXS] = // Warning: it is very important to include %s in the following sentences
{ {
#if L==1 // ca // Usr_SEX_UNKNOWN #if L==1 // ca // Usr_SEX_UNKNOWN
"Benvingut/da, %s, i feli&ccedil; aniversari!" "Benvingut/da, %s, feli&ccedil; aniversari!"
#elif L==2 // de #elif L==2 // de
"Willkommen, %s, und alles Gute zum Geburtstag!" "Willkommen, %s, alles Gute zum Geburtstag!"
#elif L==3 // en #elif L==3 // en
"Welcome, %s, and happy birthday!" "Welcome, %s, happy birthday!"
#elif L==4 // es #elif L==4 // es
"Bienvenido/a, %s, &iexcl;y feliz cumplea&ntilde;os!" "Bienvenido/a, %s, &iexcl;feliz cumplea&ntilde;os!"
#elif L==5 // fr #elif L==5 // fr
"Bienvenu(e), %s, et joyeux anniversaire!" "Bienvenu(e), %s, joyeux anniversaire!"
#elif L==6 // gn #elif L==6 // gn
"Bienvenido/a, %s, &iexcl;y feliz cumplea&ntilde;os!"// Okoteve traducción "Bienvenido/a, %s, &iexcl;feliz cumplea&ntilde;os!"// Okoteve traducción
#elif L==7 // it #elif L==7 // it
"Benvenuto/a, %s, e buon compleanno!" "Benvenuto/a, %s, buon compleanno!"
#elif L==8 // pl #elif L==8 // pl
"Witamy, %s, i wszystkiego najlepszego!" "Witamy, %s, wszystkiego najlepszego!"
#elif L==9 // pt #elif L==9 // pt
"Bem-vindo/a, %s, e feliz anivers&aacute;rio!" "Bem-vindo/a, %s, feliz anivers&aacute;rio!"
#endif #endif
, ,
#if L==1 // ca // Usr_SEX_FEMALE #if L==1 // ca // Usr_SEX_FEMALE
"Benvinguda, %s, i feli&ccedil; aniversari!" "Benvinguda, %s, feli&ccedil; aniversari!"
#elif L==2 // de #elif L==2 // de
"Willkommen, %s, und alles Gute zum Geburtstag!" "Willkommen, %s, alles Gute zum Geburtstag!"
#elif L==3 // en #elif L==3 // en
"Welcome, %s, and happy birthday!" "Welcome, %s, happy birthday!"
#elif L==4 // es #elif L==4 // es
"Bienvenida, %s, &iexcl;y feliz cumplea&ntilde;os!" "Bienvenida, %s, &iexcl;feliz cumplea&ntilde;os!"
#elif L==5 // fr #elif L==5 // fr
"Bienvenue, %s, et joyeux anniversaire!" "Bienvenue, %s, joyeux anniversaire!"
#elif L==6 // gn #elif L==6 // gn
"Bienvenida, %s, &iexcl;y feliz cumplea&ntilde;os!"// Okoteve traducción "Bienvenida, %s, &iexcl;feliz cumplea&ntilde;os!"// Okoteve traducción
#elif L==7 // it #elif L==7 // it
"Benvenuta, %s, e buon compleanno!" "Benvenuta, %s, buon compleanno!"
#elif L==8 // pl #elif L==8 // pl
"Witamy, %s, i wszystkiego najlepszego!" "Witamy, %s, wszystkiego najlepszego!"
#elif L==9 // pt #elif L==9 // pt
"Bem-vinda, %s, e feliz anivers&aacute;rio!" "Bem-vinda, %s, feliz anivers&aacute;rio!"
#endif #endif
, ,
#if L==1 // ca // Usr_SEX_MALE #if L==1 // ca // Usr_SEX_MALE
"Benvingut, %s, i feli&ccedil; aniversari!" "Benvingut, %s, feli&ccedil; aniversari!"
#elif L==2 // de #elif L==2 // de
"Willkommen, %s, und alles Gute zum Geburtstag!" "Willkommen, %s, alles Gute zum Geburtstag!"
#elif L==3 // en #elif L==3 // en
"Welcome, %s, and happy birthday!" "Welcome, %s, happy birthday!"
#elif L==4 // es #elif L==4 // es
"Bienvenido, %s, &iexcl;y feliz cumplea&ntilde;os!" "Bienvenido, %s, &iexcl;feliz cumplea&ntilde;os!"
#elif L==5 // fr #elif L==5 // fr
"Bienvenu, %s, et joyeux anniversaire!" "Bienvenu, %s, joyeux anniversaire!"
#elif L==6 // gn #elif L==6 // gn
"Bienvenido, %s, &iexcl;y feliz cumplea&ntilde;os!"// Okoteve traducción "Bienvenido, %s, &iexcl;feliz cumplea&ntilde;os!"// Okoteve traducción
#elif L==7 // it #elif L==7 // it
"Benvenuto, %s, e buon compleanno!" "Benvenuto, %s, buon compleanno!"
#elif L==8 // pl #elif L==8 // pl
"Witamy, %s, i wszystkiego najlepszego!" "Witamy, %s, wszystkiego najlepszego!"
#elif L==9 // pt #elif L==9 // pt
"Bem-vindo, %s, e feliz anivers&aacute;rio!" "Bem-vindo, %s, feliz anivers&aacute;rio!"
#endif #endif
, ,
#if L==1 // ca // Usr_SEX_ALL #if L==1 // ca // Usr_SEX_ALL
"Benvingut/da, %s, i feli&ccedil; aniversari!" "Benvingut/da, %s, feli&ccedil; aniversari!"
#elif L==2 // de #elif L==2 // de
"Willkommen, %s, und alles Gute zum Geburtstag!" "Willkommen, %s, alles Gute zum Geburtstag!"
#elif L==3 // en #elif L==3 // en
"Welcome, %s, and happy birthday!" "Welcome, %s, happy birthday!"
#elif L==4 // es #elif L==4 // es
"Bienvenido/a, %s, &iexcl;y feliz cumplea&ntilde;os!" "Bienvenido/a, %s, &iexcl;feliz cumplea&ntilde;os!"
#elif L==5 // fr #elif L==5 // fr
"Bienvenu(e), %s, et joyeux anniversaire!" "Bienvenu(e), %s, joyeux anniversaire!"
#elif L==6 // gn #elif L==6 // gn
"Bienvenido/a, %s, &iexcl;y feliz cumplea&ntilde;os!"// Okoteve traducción "Bienvenido/a, %s, &iexcl;feliz cumplea&ntilde;os!"// Okoteve traducción
#elif L==7 // it #elif L==7 // it
"Benvenuto/a, %s, e buon compleanno!" "Benvenuto/a, %s, buon compleanno!"
#elif L==8 // pl #elif L==8 // pl
"Witamy, %s, i wszystkiego najlepszego!" "Witamy, %s, wszystkiego najlepszego!"
#elif L==9 // pt #elif L==9 // pt
"Bem-vindo/a, %s, e feliz anivers&aacute;rio!" "Bem-vindo/a, %s, feliz anivers&aacute;rio!"
#endif #endif
}; };

View File

@ -25,10 +25,12 @@
/*********************************** Headers *********************************/ /*********************************** Headers *********************************/
/*****************************************************************************/ /*****************************************************************************/
#define _GNU_SOURCE // For asprintf
#include <ctype.h> // For isalnum, isdigit, etc. #include <ctype.h> // For isalnum, isdigit, etc.
#include <limits.h> // For maximum values #include <limits.h> // For maximum values
#include <linux/limits.h> // For PATH_MAX #include <linux/limits.h> // For PATH_MAX
#include <linux/stddef.h> // For NULL #include <linux/stddef.h> // For NULL
#include <stdio.h> // For asprintf
#include <stdlib.h> // For exit, system, malloc, free, rand, etc. #include <stdlib.h> // For exit, system, malloc, free, rand, etc.
#include <string.h> // For string functions #include <string.h> // For string functions
#include <sys/wait.h> // For the macro WEXITSTATUS #include <sys/wait.h> // For the macro WEXITSTATUS
@ -2507,14 +2509,21 @@ void Usr_WelcomeUsr (void)
{ {
extern const unsigned Txt_Current_CGI_SWAD_Language; extern const unsigned Txt_Current_CGI_SWAD_Language;
extern const char *Txt_Happy_birthday; extern const char *Txt_Happy_birthday;
extern const char *Txt_Welcome_X_and_happy_birthday[Usr_NUM_SEXS]; extern const char *Txt_Welcome_X_happy_birthday[Usr_NUM_SEXS];
extern const char *Txt_Welcome_X[Usr_NUM_SEXS]; extern const char *Txt_Welcome_X[Usr_NUM_SEXS];
extern const char *Txt_Welcome[Usr_NUM_SEXS]; extern const char *Txt_Welcome[Usr_NUM_SEXS];
extern const char *Txt_Please_check_your_email_address;
extern const char *Txt_Check;
extern const char *Txt_Switching_to_LANGUAGE[1 + Lan_NUM_LANGUAGES]; extern const char *Txt_Switching_to_LANGUAGE[1 + Lan_NUM_LANGUAGES];
char *WelcomeTxt;
bool EmailNeedsToBeConfirmed;
bool CongratulateMyBirthday; bool CongratulateMyBirthday;
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
EmailNeedsToBeConfirmed = (Gbl.Usrs.Me.UsrDat.Email[0] &&
!Gbl.Usrs.Me.UsrDat.EmailConfirmed);
if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_Current_CGI_SWAD_Language) if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_Current_CGI_SWAD_Language)
{ {
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\"" fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
@ -2535,17 +2544,35 @@ void Usr_WelcomeUsr (void)
Gbl.Prefs.URLIconSet, Gbl.Prefs.URLIconSet,
Txt_Happy_birthday, Txt_Happy_birthday,
Txt_Happy_birthday); Txt_Happy_birthday);
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), if (asprintf (&WelcomeTxt,Txt_Welcome_X_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex],
Txt_Welcome_X_and_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex], Gbl.Usrs.Me.UsrDat.FirstName) < 0)
Gbl.Usrs.Me.UsrDat.FirstName); Lay_NotEnoughMemoryExit ();
} }
if (!CongratulateMyBirthday) if (!CongratulateMyBirthday)
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), if (asprintf (&WelcomeTxt,Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex],
Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex], Gbl.Usrs.Me.UsrDat.FirstName) < 0)
Gbl.Usrs.Me.UsrDat.FirstName); Lay_NotEnoughMemoryExit ();
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
if (EmailNeedsToBeConfirmed)
{
/* Welcome alert with button to check email address */
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
"%s %s",
WelcomeTxt,
Txt_Please_check_your_email_address);
Ale_ShowAlertAndButton (Ale_WARNING,Gbl.Alert.Txt,
ActFrmMyAcc,NULL,NULL,NULL,
Btn_CONFIRM_BUTTON,Txt_Check);
}
else
/* Welcome alert */
Ale_ShowAlert (Ale_INFO,WelcomeTxt);
/* Free allocated memory for subquery */
free ((void *) WelcomeTxt);
} }
else else
/* Welcome alert */
Ale_ShowAlert (Ale_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]); Ale_ShowAlert (Ale_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]);
/***** Institutional video *****/ /***** Institutional video *****/
@ -2567,13 +2594,8 @@ void Usr_WelcomeUsr (void)
"</video>"); "</video>");
*/ */
/***** Warning to confirm my email address *****/
if (Gbl.Usrs.Me.UsrDat.Email[0] &&
!Gbl.Usrs.Me.UsrDat.EmailConfirmed)
Mai_PutButtonToCheckEmailAddress ();
/***** Show help to enrol me *****/ /***** Show help to enrol me *****/
Hlp_ShowHelpWhatWouldYouLikeToDo (); // Hlp_ShowHelpWhatWouldYouLikeToDo ();
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");