mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-08 09:45:26 +02:00
Version 16.63
This commit is contained in:
parent
d3d0841e7d
commit
ce06cfb553
|
@ -93,7 +93,7 @@ void RSS_UpdateRSSFileForACrs (struct Course *Crs)
|
||||||
fprintf (FileRSS,"<language>%s</language>\n",
|
fprintf (FileRSS,"<language>%s</language>\n",
|
||||||
Cfg_RSS_LANGUAGE);
|
Cfg_RSS_LANGUAGE);
|
||||||
fprintf (FileRSS,"<webMaster>%s (%s)</webMaster>\n",
|
fprintf (FileRSS,"<webMaster>%s (%s)</webMaster>\n",
|
||||||
Cfg_PLATFORM_RESPONSIBLE_E_MAIL,Cfg_PLATFORM_RESPONSIBLE_NAME);
|
Cfg_PLATFORM_RESPONSIBLE_EMAIL,Cfg_PLATFORM_RESPONSIBLE_NAME);
|
||||||
|
|
||||||
fprintf (FileRSS,"<image>\n");
|
fprintf (FileRSS,"<image>\n");
|
||||||
fprintf (FileRSS,"<url>%s/swad112x32.png</url>\n",
|
fprintf (FileRSS,"<url>%s/swad112x32.png</url>\n",
|
||||||
|
|
|
@ -360,7 +360,7 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith
|
||||||
Txt_HELP_nickname,
|
Txt_HELP_nickname,
|
||||||
NewNicknameWithArroba);
|
NewNicknameWithArroba);
|
||||||
|
|
||||||
/***** E-mail *****/
|
/***** Email *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
|
@ -425,26 +425,26 @@ void Acc_ShowFormChangeMyAccount (void)
|
||||||
bool IShouldConfirmEmail = false;
|
bool IShouldConfirmEmail = false;
|
||||||
bool IShouldFillID = false;
|
bool IShouldFillID = false;
|
||||||
|
|
||||||
/***** Get current user's nickname and e-mail address
|
/***** Get current user's nickname and email address
|
||||||
It's necessary because current nickname or e-mail could be just updated *****/
|
It's necessary because current nickname or email could be just updated *****/
|
||||||
Nck_GetNicknameFromUsrCod (Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.Nickname);
|
Nck_GetNicknameFromUsrCod (Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.Nickname);
|
||||||
Mai_GetEmailFromUsrCod (&Gbl.Usrs.Me.UsrDat);
|
Mai_GetEmailFromUsrCod (&Gbl.Usrs.Me.UsrDat);
|
||||||
|
|
||||||
/***** Check nickname, e-mail and ID *****/
|
/***** Check nickname, email and ID *****/
|
||||||
if (!Gbl.Usrs.Me.UsrDat.Nickname[0])
|
if (!Gbl.Usrs.Me.UsrDat.Nickname[0])
|
||||||
IMustFillNickname = true;
|
IMustFillNickname = true;
|
||||||
else if (!Gbl.Usrs.Me.UsrDat.Email[0])
|
else if (!Gbl.Usrs.Me.UsrDat.Email[0])
|
||||||
IMustFillEmail = true;
|
IMustFillEmail = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!Gbl.Usrs.Me.UsrDat.EmailConfirmed && // E-mail not yet confirmed
|
if (!Gbl.Usrs.Me.UsrDat.EmailConfirmed && // Email not yet confirmed
|
||||||
!Gbl.Usrs.Me.ConfirmEmailJustSent) // Do not ask for e-mail confirmation when confirmation e-mail is just sent
|
!Gbl.Usrs.Me.ConfirmEmailJustSent) // Do not ask for email confirmation when confirmation email is just sent
|
||||||
IShouldConfirmEmail = true;
|
IShouldConfirmEmail = true;
|
||||||
if (!Gbl.Usrs.Me.UsrDat.IDs.Num)
|
if (!Gbl.Usrs.Me.UsrDat.IDs.Num)
|
||||||
IShouldFillID = true;
|
IShouldFillID = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Show alert to report that confirmation e-mail has been sent *****/
|
/***** Show alert to report that confirmation email has been sent *****/
|
||||||
if (Gbl.Usrs.Me.ConfirmEmailJustSent)
|
if (Gbl.Usrs.Me.ConfirmEmailJustSent)
|
||||||
Mai_ShowMsgConfirmEmailHasBeenSent ();
|
Mai_ShowMsgConfirmEmailHasBeenSent ();
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ void Acc_ShowFormChangeMyAccount (void)
|
||||||
/***** Separator *****/
|
/***** Separator *****/
|
||||||
Acc_PrintAccountSeparator ();
|
Acc_PrintAccountSeparator ();
|
||||||
|
|
||||||
/***** E-mail *****/
|
/***** Email *****/
|
||||||
if (IMustFillEmail || IShouldConfirmEmail)
|
if (IMustFillEmail || IShouldConfirmEmail)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
@ -568,10 +568,10 @@ bool Acc_CreateMyNewAccountAndLogIn (void)
|
||||||
Nck_UpdateMyNick (NewNicknameWithoutArroba);
|
Nck_UpdateMyNick (NewNicknameWithoutArroba);
|
||||||
strcpy (Gbl.Usrs.Me.UsrDat.Nickname,NewNicknameWithoutArroba);
|
strcpy (Gbl.Usrs.Me.UsrDat.Nickname,NewNicknameWithoutArroba);
|
||||||
|
|
||||||
/***** Save e-mail *****/
|
/***** Save email *****/
|
||||||
if (Mai_UpdateEmailInDB (&Gbl.Usrs.Me.UsrDat,NewEmail))
|
if (Mai_UpdateEmailInDB (&Gbl.Usrs.Me.UsrDat,NewEmail))
|
||||||
{
|
{
|
||||||
/* E-mail updated sucessfully */
|
/* Email updated sucessfully */
|
||||||
strcpy (Gbl.Usrs.Me.UsrDat.Email,NewEmail);
|
strcpy (Gbl.Usrs.Me.UsrDat.Email,NewEmail);
|
||||||
Gbl.Usrs.Me.UsrDat.EmailConfirmed = false;
|
Gbl.Usrs.Me.UsrDat.EmailConfirmed = false;
|
||||||
}
|
}
|
||||||
|
@ -640,17 +640,17 @@ static bool Acc_GetParamsNewAccount (char *NewNicknameWithoutArroba,
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Step 2/3: Get new e-mail from form *****/
|
/***** Step 2/3: Get new email from form *****/
|
||||||
Par_GetParToText ("NewEmail",NewEmail,Usr_MAX_BYTES_USR_EMAIL);
|
Par_GetParToText ("NewEmail",NewEmail,Usr_MAX_BYTES_USR_EMAIL);
|
||||||
|
|
||||||
if (Mai_CheckIfEmailIsValid (NewEmail)) // New e-mail is valid
|
if (Mai_CheckIfEmailIsValid (NewEmail)) // New email is valid
|
||||||
{
|
{
|
||||||
/* Check if the new e-mail matches
|
/* Check if the new email matches
|
||||||
any of the confirmed e-mails of other users */
|
any of the confirmed emails of other users */
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
|
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
|
||||||
" WHERE E_mail='%s' AND Confirmed='Y'",
|
" WHERE E_mail='%s' AND Confirmed='Y'",
|
||||||
NewEmail);
|
NewEmail);
|
||||||
if (DB_QueryCOUNT (Query,"can not check if e-mail already existed")) // An e-mail of another user is the same that my e-mail
|
if (DB_QueryCOUNT (Query,"can not check if email already existed")) // An email of another user is the same that my email
|
||||||
{
|
{
|
||||||
Error = true;
|
Error = true;
|
||||||
sprintf (Gbl.Message,Txt_The_email_address_X_had_been_registered_by_another_user,
|
sprintf (Gbl.Message,Txt_The_email_address_X_had_been_registered_by_another_user,
|
||||||
|
@ -658,7 +658,7 @@ static bool Acc_GetParamsNewAccount (char *NewNicknameWithoutArroba,
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // New e-mail is not valid
|
else // New email is not valid
|
||||||
{
|
{
|
||||||
Error = true;
|
Error = true;
|
||||||
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
|
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
|
||||||
|
@ -1118,14 +1118,14 @@ static void Acc_RemoveUsr (struct UsrData *UsrDat)
|
||||||
UsrDat->UsrCod);
|
UsrDat->UsrCod);
|
||||||
DB_QueryDELETE (Query,"can not remove user's nicknames");
|
DB_QueryDELETE (Query,"can not remove user's nicknames");
|
||||||
|
|
||||||
/***** Remove user's e-mails *****/
|
/***** Remove user's emails *****/
|
||||||
sprintf (Query,"DELETE FROM pending_emails WHERE UsrCod='%ld'",
|
sprintf (Query,"DELETE FROM pending_emails WHERE UsrCod='%ld'",
|
||||||
UsrDat->UsrCod);
|
UsrDat->UsrCod);
|
||||||
DB_QueryDELETE (Query,"can not remove pending user's e-mails");
|
DB_QueryDELETE (Query,"can not remove pending user's emails");
|
||||||
|
|
||||||
sprintf (Query,"DELETE FROM usr_emails WHERE UsrCod='%ld'",
|
sprintf (Query,"DELETE FROM usr_emails WHERE UsrCod='%ld'",
|
||||||
UsrDat->UsrCod);
|
UsrDat->UsrCod);
|
||||||
DB_QueryDELETE (Query,"can not remove user's e-mails");
|
DB_QueryDELETE (Query,"can not remove user's emails");
|
||||||
|
|
||||||
/***** Remove user's IDs *****/
|
/***** Remove user's IDs *****/
|
||||||
sprintf (Query,"DELETE FROM usr_IDs WHERE UsrCod='%ld'",
|
sprintf (Query,"DELETE FROM usr_IDs WHERE UsrCod='%ld'",
|
||||||
|
|
|
@ -1049,15 +1049,15 @@ Users:
|
||||||
879. ActChgPwdStd Change the password of another user
|
879. ActChgPwdStd Change the password of another user
|
||||||
880. ActChgPwdTch Change the password of another user
|
880. ActChgPwdTch Change the password of another user
|
||||||
|
|
||||||
881. ActFrmMaiOth Show form to the change of the e-mail of another user
|
881. ActFrmMaiOth Show form to the change of the email of another user
|
||||||
882. ActFrmMaiStd Show form to the change of the e-mail of another user
|
882. ActFrmMaiStd Show form to the change of the email of another user
|
||||||
883. ActFrmMaiTch Show form to the change of the e-mail of another user
|
883. ActFrmMaiTch Show form to the change of the email of another user
|
||||||
884. ActRemMaiOth Remove one of the e-mail of another user
|
884. ActRemMaiOth Remove one of the email of another user
|
||||||
885. ActRemMaiStd Remove one of the e-mail of another user
|
885. ActRemMaiStd Remove one of the email of another user
|
||||||
886. ActRemMaiTch Remove one of the e-mail of another user
|
886. ActRemMaiTch Remove one of the email of another user
|
||||||
887. ActNewMaiOth Create a new user's e-mail for another user
|
887. ActNewMaiOth Create a new user's email for another user
|
||||||
888. ActNewMaiStd Create a new user's e-mail for another user
|
888. ActNewMaiStd Create a new user's email for another user
|
||||||
889. ActNewMaiTch Create a new user's e-mail for another user
|
889. ActNewMaiTch Create a new user's email for another user
|
||||||
|
|
||||||
890. ActRemStdCrs Remove a student from the current course
|
890. ActRemStdCrs Remove a student from the current course
|
||||||
891. ActRemTchCrs Remove a teacher from the current course
|
891. ActRemTchCrs Remove a teacher from the current course
|
||||||
|
@ -1258,7 +1258,7 @@ Messages:
|
||||||
1075. ActReqMsgUsr Write message to several users
|
1075. ActReqMsgUsr Write message to several users
|
||||||
1076. ActSeeRcvMsg Show the messages received from other users (link in menu)
|
1076. ActSeeRcvMsg Show the messages received from other users (link in menu)
|
||||||
1077. ActSeeSntMsg Show the messages sent to other users
|
1077. ActSeeSntMsg Show the messages sent to other users
|
||||||
1078. ActMaiStd Send an e-mail to students
|
1078. ActMaiStd Send an email to students
|
||||||
1079. ActWriAnn Show form to create a new global announcement
|
1079. ActWriAnn Show form to create a new global announcement
|
||||||
1080. ActRcvAnn Receive and create a new global announcement
|
1080. ActRcvAnn Receive and create a new global announcement
|
||||||
1081. ActHidAnn Hide a global announcement that was active
|
1081. ActHidAnn Hide a global announcement that was active
|
||||||
|
@ -1332,8 +1332,8 @@ Profile:
|
||||||
1146. ActEdiPrf Show forms to edit preferences
|
1146. ActEdiPrf Show forms to edit preferences
|
||||||
1147. ActAdmBrf Show the briefcase of private archives
|
1147. ActAdmBrf Show the briefcase of private archives
|
||||||
|
|
||||||
1148. ActReqSndNewPwd Show form to send a new password via e-mail
|
1148. ActReqSndNewPwd Show form to send a new password via email
|
||||||
1149. ActSndNewPwd Send a new password via e-mail
|
1149. ActSndNewPwd Send a new password via email
|
||||||
1150. ActLogOut Close session
|
1150. ActLogOut Close session
|
||||||
|
|
||||||
1151. ActAutUsrInt Authentify user internally (directly from the platform)
|
1151. ActAutUsrInt Authentify user internally (directly from the platform)
|
||||||
|
@ -1348,9 +1348,9 @@ Profile:
|
||||||
1159. ActNewIDMe Create a new user's ID for me
|
1159. ActNewIDMe Create a new user's ID for me
|
||||||
1160. ActRemOldNic Remove one of my old nicknames
|
1160. ActRemOldNic Remove one of my old nicknames
|
||||||
1161. ActChgNic Change my nickname
|
1161. ActChgNic Change my nickname
|
||||||
1162. ActRemMaiMe Remove one of my old e-mails
|
1162. ActRemMaiMe Remove one of my old emails
|
||||||
1163. ActNewMaiMe Change my e-mail address
|
1163. ActNewMaiMe Change my email address
|
||||||
1164. ActCnfMai Confirm e-mail address
|
1164. ActCnfMai Confirm email address
|
||||||
1165. ActFrmChgMyPwd Show form to the change of the password
|
1165. ActFrmChgMyPwd Show form to the change of the password
|
||||||
1166. ActChgPwd Change the password
|
1166. ActChgPwd Change the password
|
||||||
1167. ActReqRemMyAcc Request the removal of my account
|
1167. ActReqRemMyAcc Request the removal of my account
|
||||||
|
@ -1390,7 +1390,7 @@ Profile:
|
||||||
1195. ActShoRgtCol Show right side column
|
1195. ActShoRgtCol Show right side column
|
||||||
1196. ActChgIco Change icon set
|
1196. ActChgIco Change icon set
|
||||||
1197. ActChgMnu Change menu
|
1197. ActChgMnu Change menu
|
||||||
1198. ActChgNtfPrf Change whether to notify by e-mail new messages
|
1198. ActChgNtfPrf Change whether to notify by email new messages
|
||||||
1199. ActPrnUsrQR Show my QR code ready to print
|
1199. ActPrnUsrQR Show my QR code ready to print
|
||||||
|
|
||||||
1200. ActPrnMyTT Show the timetable listo to impresión of all my courses
|
1200. ActPrnMyTT Show the timetable listo to impresión of all my courses
|
||||||
|
@ -2682,7 +2682,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
||||||
/* ActReqMsgUsr */{ 26, 3,TabMsg,ActReqMsgUsr ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Msg_FormMsgUsrs ,"editnewmsg64x64.gif" },
|
/* ActReqMsgUsr */{ 26, 3,TabMsg,ActReqMsgUsr ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Msg_FormMsgUsrs ,"editnewmsg64x64.gif" },
|
||||||
/* ActSeeRcvMsg */{ 3, 4,TabMsg,ActSeeRcvMsg ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Msg_ShowRecMsgs ,"recmsg64x64.gif" },
|
/* ActSeeRcvMsg */{ 3, 4,TabMsg,ActSeeRcvMsg ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Msg_ShowRecMsgs ,"recmsg64x64.gif" },
|
||||||
/* ActSeeSntMsg */{ 70, 5,TabMsg,ActSeeSntMsg ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Msg_ShowSntMsgs ,"sntmsg64x64.gif" },
|
/* ActSeeSntMsg */{ 70, 5,TabMsg,ActSeeSntMsg ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Msg_ShowSntMsgs ,"sntmsg64x64.gif" },
|
||||||
/* ActMaiStd */{ 100, 6,TabMsg,ActMaiStd ,0x110,0x100,0x000,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Mai_ListEMails ,"email64x64.gif" },
|
/* ActMaiStd */{ 100, 6,TabMsg,ActMaiStd ,0x110,0x100,0x000,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Mai_ListEmails ,"email64x64.gif" },
|
||||||
|
|
||||||
// Actions not in menu:
|
// Actions not in menu:
|
||||||
/* ActWriAnn */{1237,-1,TabUnk,ActSeeAnn ,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ann_ShowFormAnnouncement ,NULL},
|
/* ActWriAnn */{1237,-1,TabUnk,ActSeeAnn ,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ann_ShowFormAnnouncement ,NULL},
|
||||||
|
@ -4848,7 +4848,7 @@ void Act_AdjustCurrentAction (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** If I have no nickname or e-mail in database,
|
/***** If I have no nickname or email in database,
|
||||||
the only action possible is show a form to change my account *****/
|
the only action possible is show a form to change my account *****/
|
||||||
if (!Gbl.Usrs.Me.UsrDat.Nickname[0] ||
|
if (!Gbl.Usrs.Me.UsrDat.Nickname[0] ||
|
||||||
!Gbl.Usrs.Me.UsrDat.Email[0])
|
!Gbl.Usrs.Me.UsrDat.Email[0])
|
||||||
|
|
|
@ -1361,7 +1361,7 @@ void Asg_RecFormAssignment (void)
|
||||||
/* Free memory for list of selected groups */
|
/* Free memory for list of selected groups */
|
||||||
Grp_FreeListCodSelectedGrps ();
|
Grp_FreeListCodSelectedGrps ();
|
||||||
|
|
||||||
/***** Notify by e-mail about the new assignment *****/
|
/***** Notify by email about the new assignment *****/
|
||||||
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_ASSIGNMENT,NewAsg.AsgCod)))
|
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_ASSIGNMENT,NewAsg.AsgCod)))
|
||||||
Asg_UpdateNumUsrsNotifiedByEMailAboutAssignment (NewAsg.AsgCod,NumUsrsToBeNotifiedByEMail);
|
Asg_UpdateNumUsrsNotifiedByEMailAboutAssignment (NewAsg.AsgCod,NumUsrsToBeNotifiedByEMail);
|
||||||
Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (NumUsrsToBeNotifiedByEMail);
|
Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (NumUsrsToBeNotifiedByEMail);
|
||||||
|
@ -1822,7 +1822,7 @@ unsigned Asg_GetNumAssignments (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
if (sscanf (row[0],"%u",&NumAssignments) != 1)
|
if (sscanf (row[0],"%u",&NumAssignments) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of assignments.");
|
Lay_ShowErrorAndExit ("Error when getting number of assignments.");
|
||||||
|
|
||||||
/***** Get number of notifications by e-mail *****/
|
/***** Get number of notifications by email *****/
|
||||||
if (row[1])
|
if (row[1])
|
||||||
{
|
{
|
||||||
if (sscanf (row[1],"%u",NumNotif) != 1)
|
if (sscanf (row[1],"%u",NumNotif) != 1)
|
||||||
|
|
|
@ -1792,7 +1792,7 @@ unsigned Att_GetNumAttEvents (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
if (sscanf (row[0],"%u",&NumAttEvents) != 1)
|
if (sscanf (row[0],"%u",&NumAttEvents) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of attendance events.");
|
Lay_ShowErrorAndExit ("Error when getting number of attendance events.");
|
||||||
|
|
||||||
/***** Get number of notifications by e-mail *****/
|
/***** Get number of notifications by email *****/
|
||||||
if (row[1])
|
if (row[1])
|
||||||
{
|
{
|
||||||
if (sscanf (row[1],"%u",NumNotif) != 1)
|
if (sscanf (row[1],"%u",NumNotif) != 1)
|
||||||
|
|
|
@ -145,7 +145,7 @@
|
||||||
// TODO: Writing a message to several recipients: include message to indicate that list of nicknames must be comma separated
|
// TODO: Writing a message to several recipients: include message to indicate that list of nicknames must be comma separated
|
||||||
// TODO: When requesting inscription, I can not click in the photo of my record. Change the form?
|
// TODO: When requesting inscription, I can not click in the photo of my record. Change the form?
|
||||||
|
|
||||||
// TODO: Import ID, e-mail, Surname1, Surname2, Name from CSV, suggested by Javier Melero
|
// TODO: Import ID, email, Surname1, Surname2, Name from CSV, suggested by Javier Melero
|
||||||
|
|
||||||
// TODO: Remove columns DegCod,CrsCod from database table surveys
|
// TODO: Remove columns DegCod,CrsCod from database table surveys
|
||||||
|
|
||||||
|
@ -153,19 +153,29 @@
|
||||||
|
|
||||||
// TODO: When an assignment has the same name or the same folder as another existing assignment, after error the fields are empty!
|
// TODO: When an assignment has the same name or the same folder as another existing assignment, after error the fields are empty!
|
||||||
|
|
||||||
|
// TODO: Remove all files inside the root folder (except the root folder itself) just as made with copy-paste?
|
||||||
|
|
||||||
|
// TODO: Cuando se seleccionan varios alumnos para sus trabajos y después se vuelve atrás y se vuelven a ver, salen los estudiantes duplicados ==> comprobar cada uno de los que se muestra si ya se ha mostrado para no hacerlo de nuevo
|
||||||
|
|
||||||
|
// TODO: Comprobar que cuando se da de baja un estudiante y luego se vuelve a dar de alta se han eliminado sus trabajos (Javier dice que no se eliminan)
|
||||||
|
|
||||||
|
// TODO: Hay un problema cuando se eliminan usuarios de una asignatura: quedan sus trabajos sin eliminar para siempre, ocupando espacio
|
||||||
|
// TODO: Se elimina un único estudiante de la asignatura. ¿Se eliminan sus trabajos? Si no, habría que cambiar el mensaje "eliminando sus trabajos...".
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.62.2 (2016-11-14)"
|
#define Log_PLATFORM_VERSION "SWAD 16.63 (2016-11-16)"
|
||||||
#define CSS_FILE "swad16.60.1.css"
|
#define CSS_FILE "swad16.60.1.css"
|
||||||
#define JS_FILE "swad16.46.1.js"
|
#define JS_FILE "swad16.46.1.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
Version 16.62.2: Nov 14, 2016 Changes message related to clipboard.
|
Version 16.63: Nov 16, 2016 "e-mail" changed to "email", except in database fields. (? lines)
|
||||||
Fixed minor bug when copying all files inside root folder. (207157 lines)
|
Version 16.62.2: Nov 14, 2016 Changed message related to clipboard.
|
||||||
|
Fixed minor bug when copying all files inside root folder. (207158 lines)
|
||||||
Version 16.62.1: Nov 14, 2016 Code refactoring in clipboard. (207151 lines)
|
Version 16.62.1: Nov 14, 2016 Code refactoring in clipboard. (207151 lines)
|
||||||
Version 16.62: Nov 14, 2016 Copy of all files inside root folder is now allowed (root folder not copied). (207165 lines)
|
Version 16.62: Nov 14, 2016 Copy of all files inside root folder is now allowed (root folder not copied). (207165 lines)
|
||||||
Version 16.61.8: Nov 14, 2016 Code refactoring in clipboard. (207148 lines)
|
Version 16.61.8: Nov 14, 2016 Code refactoring in clipboard. (207148 lines)
|
||||||
|
@ -427,15 +437,15 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1587','es','N','Move
|
||||||
Version 16.21.3: Oct 12, 2016 Changes in layout of file browser. (205266 lines)
|
Version 16.21.3: Oct 12, 2016 Changes in layout of file browser. (205266 lines)
|
||||||
Version 16.21.2: Oct 12, 2016 Unused code removed from actions. (205263 lines)
|
Version 16.21.2: Oct 12, 2016 Unused code removed from actions. (205263 lines)
|
||||||
Version 16.21.1: Oct 12, 2016 Code refactoring in actions. (205280 lines)
|
Version 16.21.1: Oct 12, 2016 Code refactoring in actions. (205280 lines)
|
||||||
Version 16.21: Oct 12, 2016 Code refactoring related with warning about e-mail notifications.
|
Version 16.21: Oct 12, 2016 Code refactoring related with warning about email notifications.
|
||||||
Notification mail is sent only if e-mail is confirmed. (205278 lines)
|
Notification mail is sent only if email is confirmed. (205278 lines)
|
||||||
Version 16.20: Oct 11, 2016 New button to edit/view file browser. (205241 lines)
|
Version 16.20: Oct 11, 2016 New button to edit/view file browser. (205241 lines)
|
||||||
Version 16.19.3: Oct 11, 2016 Code optimization in file browser. (205210 lines)
|
Version 16.19.3: Oct 11, 2016 Code optimization in file browser. (205210 lines)
|
||||||
Version 16.19.2: Oct 11, 2016 Code optimization in file browser. (205198 lines)
|
Version 16.19.2: Oct 11, 2016 Code optimization in file browser. (205198 lines)
|
||||||
Version 16.19.1: Oct 10, 2016 Message to report that confirmation e-mail has been sent. (205203 lines)
|
Version 16.19.1: Oct 10, 2016 Message to report that confirmation email has been sent. (205203 lines)
|
||||||
Version 16.19: Oct 10, 2016 Warning in User > Session to confirm user's e-mail address.
|
Version 16.19: Oct 10, 2016 Warning in User > Session to confirm user's email address.
|
||||||
Changes in form to edit user's account. (205194 lines)
|
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)
|
Version 16.18.1: Oct 10, 2016 Warning in User > Account to confirm user's email address. (205116 lines)
|
||||||
Version 16.18: Oct 09, 2016 Removed external authentication (previously used at University of Granada). (205092 lines)
|
Version 16.18: Oct 09, 2016 Removed external authentication (previously used at University of Granada). (205092 lines)
|
||||||
4 changes necessary in database:
|
4 changes necessary in database:
|
||||||
DROP TABLE IF EXISTS imported_groups;
|
DROP TABLE IF EXISTS imported_groups;
|
||||||
|
@ -599,7 +609,7 @@ ALTER TABLE msg_content_deleted CHANGE COLUMN ImageURL ImageURL VARCHAR(255) NOT
|
||||||
Version 15.247: Jul 26, 2016 In listings of users, show institution logo with link to institution. (204093 lines)
|
Version 15.247: Jul 26, 2016 In listings of users, show institution logo with link to institution. (204093 lines)
|
||||||
Version 15.246.2: Jul 26, 2016 List of users in web service use the list filled instead of querying database a second time to get all user's data.
|
Version 15.246.2: Jul 26, 2016 List of users in web service use the list filled instead of querying database a second time to get all user's data.
|
||||||
Code refactoring in copying of user's data in web service. (204089 lines)
|
Code refactoring in copying of user's data in web service. (204089 lines)
|
||||||
Version 15.246.1: Jul 26, 2016 Attendance of users and e-mail to users use the list filled instead of querying database a second time to get all user's data. (204093 lines)
|
Version 15.246.1: Jul 26, 2016 Attendance of users and email to users use the list filled instead of querying database a second time to get all user's data. (204093 lines)
|
||||||
Version 15.246: Jul 26, 2016 Classphoto of users uses the list filled instead of querying database a second time to get all user's data.
|
Version 15.246: Jul 26, 2016 Classphoto of users uses the list filled instead of querying database a second time to get all user's data.
|
||||||
Origin place is removed from classphoto. (204094 lines)
|
Origin place is removed from classphoto. (204094 lines)
|
||||||
Version 15.245.5: Jul 26, 2016 Fixed bug in user's data. (204116 lines)
|
Version 15.245.5: Jul 26, 2016 Fixed bug in user's data. (204116 lines)
|
||||||
|
@ -609,7 +619,7 @@ ALTER TABLE msg_content_deleted CHANGE COLUMN ImageURL ImageURL VARCHAR(255) NOT
|
||||||
Version 15.245.1: Jul 25, 2016 Code refactoring in building of queries to get/search users. (204081 lines)
|
Version 15.245.1: Jul 25, 2016 Code refactoring in building of queries to get/search users. (204081 lines)
|
||||||
Version 15.245: Jul 25, 2016 List of users is filled with user's name and user's institution.
|
Version 15.245: Jul 25, 2016 List of users is filled with user's name and user's institution.
|
||||||
Search of users uses the list filled instead of querying database a second time to get all user's data. (204192 lines)
|
Search of users uses the list filled instead of querying database a second time to get all user's data. (204192 lines)
|
||||||
Version 15.244: Jul 25, 2016 Removed e-mail column from some lists of users (usually it's not necessary). (203969 lines)
|
Version 15.244: Jul 25, 2016 Removed email column from some lists of users (usually it's not necessary). (203969 lines)
|
||||||
Version 15.243.2: Jul 24, 2016 Guests now have permission to write messages. (203963 lines)
|
Version 15.243.2: Jul 24, 2016 Guests now have permission to write messages. (203963 lines)
|
||||||
Version 15.243.1: Jul 21, 2016 Fixed bugs in web service. (203962 lines)
|
Version 15.243.1: Jul 21, 2016 Fixed bugs in web service. (203962 lines)
|
||||||
Version 15.243: Jul 20, 2016 Fixed bug in web service (getNotifications).
|
Version 15.243: Jul 20, 2016 Fixed bug in web service (getNotifications).
|
||||||
|
@ -646,7 +656,7 @@ DROP TABLE IF EXISTS notif_backup,sta_notif_backup,usr_data_backup;
|
||||||
Version 15.238: Jul 01, 2016 Hidden fields in in selectors of class photo / list with message subject and content. (203274 lines)
|
Version 15.238: Jul 01, 2016 Hidden fields in in selectors of class photo / list with message subject and content. (203274 lines)
|
||||||
Version 15.237.3: Jul 01, 2016 Fixed bug in messages. (203257 lines)
|
Version 15.237.3: Jul 01, 2016 Fixed bug in messages. (203257 lines)
|
||||||
Version 15.237.2: Jul 01, 2016 Fixed minor problem in textarea for message content. (203261 lines)
|
Version 15.237.2: Jul 01, 2016 Fixed minor problem in textarea for message content. (203261 lines)
|
||||||
Version 15.237.1: Jul 01, 2016 Code refactoring in function to send e-mail to students. (203254 lines)
|
Version 15.237.1: Jul 01, 2016 Code refactoring in function to send email to students. (203254 lines)
|
||||||
Version 15.237: Jul 01, 2016 The form "Show more recipients" now have a hidden field with the content. (203243 lines)
|
Version 15.237: Jul 01, 2016 The form "Show more recipients" now have a hidden field with the content. (203243 lines)
|
||||||
Version 15.236: Jun 30, 2016 The form "Show more recipients" now have a hidden field with the subject. (? lines)
|
Version 15.236: Jun 30, 2016 The form "Show more recipients" now have a hidden field with the subject. (? lines)
|
||||||
Version 15.235.1: Jun 30, 2016 Minor change in icon to download files. (203206 lines)
|
Version 15.235.1: Jun 30, 2016 Minor change in icon to download files. (203206 lines)
|
||||||
|
@ -897,9 +907,9 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1570','es','N','Conf
|
||||||
Version 15.202.4: Apr 23, 2016 Code refactoring in record card. (200926 lines)
|
Version 15.202.4: Apr 23, 2016 Code refactoring in record card. (200926 lines)
|
||||||
Version 15.202.3: Apr 23, 2016 Code refactoring in record card. (200911 lines)
|
Version 15.202.3: Apr 23, 2016 Code refactoring in record card. (200911 lines)
|
||||||
Version 15.202.2: Apr 23, 2016 Code refactoring in record card. (200899 lines)
|
Version 15.202.2: Apr 23, 2016 Code refactoring in record card. (200899 lines)
|
||||||
Version 15.202.1: Apr 23, 2016 Code refactoring related to showing user's e-mail. (200887 lines)
|
Version 15.202.1: Apr 23, 2016 Code refactoring related to showing user's email. (200887 lines)
|
||||||
Version 15.202: Apr 23, 2016 User's IDs are show in green or red.
|
Version 15.202: Apr 23, 2016 User's IDs are show in green or red.
|
||||||
Code refactoring and bug fixing related to showing user's ID and e-mail. (200908 lines)
|
Code refactoring and bug fixing related to showing user's ID and email. (200908 lines)
|
||||||
Version 15.201.9: Apr 22, 2016 Code refactoring in record card.
|
Version 15.201.9: Apr 22, 2016 Code refactoring in record card.
|
||||||
Changes in layout of record cards. (200895 lines)
|
Changes in layout of record cards. (200895 lines)
|
||||||
Version 15.201.8: Apr 22, 2016 Code refactoring in record card.
|
Version 15.201.8: Apr 22, 2016 Code refactoring in record card.
|
||||||
|
@ -2139,8 +2149,8 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1484','es','N','Camb
|
||||||
Version 15.40.1: Nov 19, 2015 Changes in behaviour of links to countries, institutions, centres and degrees. (187288 lines)
|
Version 15.40.1: Nov 19, 2015 Changes in behaviour of links to countries, institutions, centres and degrees. (187288 lines)
|
||||||
Version 15.40: Nov 17, 2015 Changes in statistics of number of users.
|
Version 15.40: Nov 17, 2015 Changes in statistics of number of users.
|
||||||
Changes in listing of countries. (187275 lines)
|
Changes in listing of countries. (187275 lines)
|
||||||
Version 15.39.1: Nov 16, 2015 User' e-mail can be removed even if it is the unique. (187236 lines)
|
Version 15.39.1: Nov 16, 2015 User' email can be removed even if it is the unique. (187236 lines)
|
||||||
Version 15.39: Nov 16, 2015 Administrators can edit another user' e-mails. (187268 lines)
|
Version 15.39: Nov 16, 2015 Administrators can edit another user' emails. (187268 lines)
|
||||||
9 changes necessary in database:
|
9 changes necessary in database:
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1475','es','N','Solicitar edición dir. correo invitado');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1475','es','N','Solicitar edición dir. correo invitado');
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1476','es','N','Solicitar edición dir. correo estudiante');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1476','es','N','Solicitar edición dir. correo estudiante');
|
||||||
|
@ -3412,7 +3422,7 @@ Copy the new swad_smtp.py into swad cgi directory
|
||||||
Changes in admin of one user for students. (167497 lines)
|
Changes in admin of one user for students. (167497 lines)
|
||||||
Version 14.5.2: Oct 11, 2014 One message translated.
|
Version 14.5.2: Oct 11, 2014 One message translated.
|
||||||
Minor code refactoring. (167396 lines)
|
Minor code refactoring. (167396 lines)
|
||||||
Version 14.5.1: Oct 08, 2014 Minor changes related to messages in automatic e-mails. (167374 lines)
|
Version 14.5.1: Oct 08, 2014 Minor changes related to messages in automatic emails. (167374 lines)
|
||||||
Version 14.5: Oct 07, 2014 Fixed issues related with charset. (167368 lines)
|
Version 14.5: Oct 07, 2014 Fixed issues related with charset. (167368 lines)
|
||||||
Version 14.4.2: Oct 07, 2014 Changes in upload of files. (167354 lines)
|
Version 14.4.2: Oct 07, 2014 Changes in upload of files. (167354 lines)
|
||||||
Version 14.4.1: Oct 07, 2014 Changes in upload of files. (167351 lines)
|
Version 14.4.1: Oct 07, 2014 Changes in upload of files. (167351 lines)
|
||||||
|
@ -3902,7 +3912,7 @@ UPDATE log SET Role=Role+1 WHERE Role>='1' AND Role<='4';
|
||||||
DELETE FROM actions WHERE ActCod='1164';
|
DELETE FROM actions WHERE ActCod='1164';
|
||||||
UPDATE actions SET Obsolete='Y' WHERE ActCod='1162';
|
UPDATE actions SET Obsolete='Y' WHERE ActCod='1162';
|
||||||
|
|
||||||
Version 13.43: Jan 29, 2014 A new account must be created with a @nick, an e-mail and an ID. (161513 lines)
|
Version 13.43: Jan 29, 2014 A new account must be created with a @nick, an email and an ID. (161513 lines)
|
||||||
Version 13.42.3: Jan 28, 2014 Changes related to user importation. (161385 lines)
|
Version 13.42.3: Jan 28, 2014 Changes related to user importation. (161385 lines)
|
||||||
Version 13.42.2: Jan 27, 2014 The number of user's IDs for a user is now limited. (161386 lines)
|
Version 13.42.2: Jan 27, 2014 The number of user's IDs for a user is now limited. (161386 lines)
|
||||||
Version 13.42.1: Jan 26, 2014 Some messages translated. (161348 lines)
|
Version 13.42.1: Jan 26, 2014 Some messages translated. (161348 lines)
|
||||||
|
@ -4209,7 +4219,7 @@ Add swad_banner.o to list of object files
|
||||||
CREATE TABLE IF NOT EXISTS banners (BanCod INT NOT NULL AUTO_INCREMENT,ShortName VARCHAR(32) NOT NULL,FullName VARCHAR(255) NOT NULL,WWW VARCHAR(255) NOT NULL,UNIQUE INDEX(BanCod));
|
CREATE TABLE IF NOT EXISTS banners (BanCod INT NOT NULL AUTO_INCREMENT,ShortName VARCHAR(32) NOT NULL,FullName VARCHAR(255) NOT NULL,WWW VARCHAR(255) NOT NULL,UNIQUE INDEX(BanCod));
|
||||||
|
|
||||||
Version 13.6: Oct 20, 2013 A teacher/admin can register another user in groups. (155736 lines)
|
Version 13.6: Oct 20, 2013 A teacher/admin can register another user in groups. (155736 lines)
|
||||||
Version 13.5: Oct 17, 2013 Register / remove several users using nicknames or e-mails, not only IDs. (155339 lines)
|
Version 13.5: Oct 17, 2013 Register / remove several users using nicknames or emails, not only IDs. (155339 lines)
|
||||||
Version 13.4.8: Oct 16, 2013 Fixed bug in searching of documents. (155326 lines)
|
Version 13.4.8: Oct 16, 2013 Fixed bug in searching of documents. (155326 lines)
|
||||||
Version 13.4.7: Oct 16, 2013 Creating ZIP is permitted for all users. (155305 lines)
|
Version 13.4.7: Oct 16, 2013 Creating ZIP is permitted for all users. (155305 lines)
|
||||||
Version 13.4.6: Oct 16, 2013 Create ZIP only if full size is less than a limit. (155281 lines)
|
Version 13.4.6: Oct 16, 2013 Create ZIP only if full size is less than a limit. (155281 lines)
|
||||||
|
@ -4261,7 +4271,7 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1123','es','N','Desc
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1111','es','N','Descargar arch. doc. asg.');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1111','es','N','Descargar arch. doc. asg.');
|
||||||
|
|
||||||
Version 13.2.2: Oct 09, 2013 User's QR code is moved to user's account.
|
Version 13.2.2: Oct 09, 2013 User's QR code is moved to user's account.
|
||||||
New QR code for confirmed e-mail. (154443 lines)
|
New QR code for confirmed email. (154443 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
UPDATE actions SET Obsolete='Y' WHERE ActCod='1021';
|
UPDATE actions SET Obsolete='Y' WHERE ActCod='1021';
|
||||||
|
|
||||||
|
@ -4362,11 +4372,11 @@ UPDATE IP_prefs SET IconSet='nuvola';
|
||||||
Version 12.67.6: Sep 17, 2013 Changes in layout. (153199 lines)
|
Version 12.67.6: Sep 17, 2013 Changes in layout. (153199 lines)
|
||||||
Version 12.67.5: Sep 15, 2013 Changes in layout. (153161 lines)
|
Version 12.67.5: Sep 15, 2013 Changes in layout. (153161 lines)
|
||||||
Version 12.67.4: Sep 14, 2013 Changes in layout. (153175 lines)
|
Version 12.67.4: Sep 14, 2013 Changes in layout. (153175 lines)
|
||||||
Version 12.67.3: Sep 14, 2013 Fixed bug in form to enter ID, @nick or e-mail. (153198 lines)
|
Version 12.67.3: Sep 14, 2013 Fixed bug in form to enter ID, @nick or email. (153198 lines)
|
||||||
Version 12.67.2: Sep 14, 2013 Fixed bug in statistics. (153198 lines)
|
Version 12.67.2: Sep 14, 2013 Fixed bug in statistics. (153198 lines)
|
||||||
Version 12.67.1: Sep 14, 2013 Changes in nickname form.
|
Version 12.67.1: Sep 14, 2013 Changes in nickname form.
|
||||||
Several messages translated. (153197 lines)
|
Several messages translated. (153197 lines)
|
||||||
Version 12.67: Sep 13, 2013 Nickname and e-mail are allowed to create, remove, change a user. (153137 lines)
|
Version 12.67: Sep 13, 2013 Nickname and email are allowed to create, remove, change a user. (153137 lines)
|
||||||
Version 12.66.1: Sep 12, 2013 User's encrypted code is used instead user's ID when possible. (153107 lines)
|
Version 12.66.1: Sep 12, 2013 User's encrypted code is used instead user's ID when possible. (153107 lines)
|
||||||
Version 12.66: Sep 11, 2013 User's code instead of user's ID in log tables. (153015 lines)
|
Version 12.66: Sep 11, 2013 User's code instead of user's ID in log tables. (153015 lines)
|
||||||
4 slow changes necessary in database (may spend many minutes or even hours depending on the size of log tables):
|
4 slow changes necessary in database (may spend many minutes or even hours depending on the size of log tables):
|
||||||
|
@ -4382,18 +4392,18 @@ UPDATE log,usr_data SET log.UsrCod=usr_data.UsrCod WHERE log.UsrCod='-1' AND log
|
||||||
Version 12.65: Sep 04, 2013 When a user logs in and no course is selected, use last visited course.
|
Version 12.65: Sep 04, 2013 When a user logs in and no course is selected, use last visited course.
|
||||||
Clear list of user's courses when he/she logs out. (152890 lines)
|
Clear list of user's courses when he/she logs out. (152890 lines)
|
||||||
Version 12.64.6: Jul 17, 2013 Fixed bug in mail domains.
|
Version 12.64.6: Jul 17, 2013 Fixed bug in mail domains.
|
||||||
Changes in e-mail form in user's account. (152848 lines)
|
Changes in email form in user's account. (152848 lines)
|
||||||
Version 12.64.5: Jun 29, 2013 Fixed bug in web service, reported by Juan Miguel Boyero Corral.
|
Version 12.64.5: Jun 29, 2013 Fixed bug in web service, reported by Juan Miguel Boyero Corral.
|
||||||
New MIME type allowed. (152811 lines)
|
New MIME type allowed. (152811 lines)
|
||||||
Version 12.64.4: Jun 11, 2013 Users can log in web service with e-mail. (152706 lines)
|
Version 12.64.4: Jun 11, 2013 Users can log in web service with email. (152706 lines)
|
||||||
Version 12.64.3: Jun 11, 2013 Fixed bug in nicknames, reported by Juan Miguel Boyero Corral. (152704 lines)
|
Version 12.64.3: Jun 11, 2013 Fixed bug in nicknames, reported by Juan Miguel Boyero Corral. (152704 lines)
|
||||||
Version 12.64.2: Jun 11, 2013 Several messages translated to spanish and english. (152715 lines)
|
Version 12.64.2: Jun 11, 2013 Several messages translated to spanish and english. (152715 lines)
|
||||||
Version 12.64.1: Jun 11, 2013 New button to confirm e-mail. (152335 lines)
|
Version 12.64.1: Jun 11, 2013 New button to confirm email. (152335 lines)
|
||||||
Version 12.64: Jun 11, 2013 Users can login with e-mail.
|
Version 12.64: Jun 11, 2013 Users can login with email.
|
||||||
Messages can be sent with e-mail.
|
Messages can be sent with email.
|
||||||
Fixed bug when changing the e-mail, reported by Francisco A. Ocaña Lara. (152361 lines)
|
Fixed bug when changing the email, reported by Francisco A. Ocaña Lara. (152361 lines)
|
||||||
Version 12.63.12:Jun 10, 2013 Changes in user's record card.
|
Version 12.63.12:Jun 10, 2013 Changes in user's record card.
|
||||||
E-mail field removed from user's data table. (152320 lines)
|
Email field removed from user's data table. (152320 lines)
|
||||||
4 changes necessary in database:
|
4 changes necessary in database:
|
||||||
DROP TABLE IF EXISTS usr_data_copy;
|
DROP TABLE IF EXISTS usr_data_copy;
|
||||||
CREATE TABLE usr_data_copy LIKE usr_data;
|
CREATE TABLE usr_data_copy LIKE usr_data;
|
||||||
|
@ -4406,18 +4416,18 @@ ALTER TABLE usr_data DROP COLUMN E_mail;
|
||||||
ALTER TABLE usr_data DROP COLUMN Nickname;
|
ALTER TABLE usr_data DROP COLUMN Nickname;
|
||||||
|
|
||||||
Version 12.63.10:Jun 06, 2013 Changes in user's record card. (152251 lines)
|
Version 12.63.10:Jun 06, 2013 Changes in user's record card. (152251 lines)
|
||||||
Version 12.63.9: May 29, 2013 E-mail address is no longer filled in user's record card, only in account.
|
Version 12.63.9: May 29, 2013 Email address is no longer filled in user's record card, only in account.
|
||||||
Nickname and e-mail are shown in record card after user's ID. (152189 lines)
|
Nickname and email are shown in record card after user's ID. (152189 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1091','es','N','Confirmar dirección de correo');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1091','es','N','Confirmar dirección de correo');
|
||||||
|
|
||||||
Version 12.63.8: May 29, 2013 E-mail address can be confirmed. (152163 lines)
|
Version 12.63.8: May 29, 2013 Email address can be confirmed. (152163 lines)
|
||||||
Version 12.63.7: May 29, 2013 E-mail address can be confirmed. (152117 lines)
|
Version 12.63.7: May 29, 2013 Email address can be confirmed. (152117 lines)
|
||||||
Version 12.63.6: May 28, 2013 E-mail address can be confirmed. (152109 lines)
|
Version 12.63.6: May 28, 2013 Email address can be confirmed. (152109 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
CREATE TABLE IF NOT EXISTS pending_emails (UsrCod INT NOT NULL,E_mail VARCHAR(255) COLLATE latin1_general_ci NOT NULL,MailKey CHAR(43) COLLATE latin1_bin NOT NULL,DateAndTime DATETIME NOT NULL,INDEX(UsrCod),UNIQUE INDEX(MailKey));
|
CREATE TABLE IF NOT EXISTS pending_emails (UsrCod INT NOT NULL,E_mail VARCHAR(255) COLLATE latin1_general_ci NOT NULL,MailKey CHAR(43) COLLATE latin1_bin NOT NULL,DateAndTime DATETIME NOT NULL,INDEX(UsrCod),UNIQUE INDEX(MailKey));
|
||||||
|
|
||||||
Version 12.63.5: May 27, 2013 E-mail address can be confirmed. (152061 lines)
|
Version 12.63.5: May 27, 2013 Email address can be confirmed. (152061 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
ALTER TABLE usr_emails ADD COLUMN Confirmed ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER CreatTime;
|
ALTER TABLE usr_emails ADD COLUMN Confirmed ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER CreatTime;
|
||||||
|
|
||||||
|
@ -4427,13 +4437,13 @@ ALTER TABLE usr_emails ADD COLUMN Confirmed ENUM('N','Y') NOT NULL DEFAULT 'N' A
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1089','es','N','Eliminar apodo');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1089','es','N','Eliminar apodo');
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1090','es','N','Eliminar dirección de correo');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1090','es','N','Eliminar dirección de correo');
|
||||||
|
|
||||||
Version 12.63.2: May 23, 2013 Changing user's e-mail. (151732 lines)
|
Version 12.63.2: May 23, 2013 Changing user's email. (151732 lines)
|
||||||
3 changes necessary in database:
|
3 changes necessary in database:
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1086','es','N','Ver datos arch. calif. asg.');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1086','es','N','Ver datos arch. calif. asg.');
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1087','es','N','Ver datos arch. calif. grp.');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1087','es','N','Ver datos arch. calif. grp.');
|
||||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1088','es','N','Cambiar mi dirección de correo');
|
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1088','es','N','Cambiar mi dirección de correo');
|
||||||
|
|
||||||
Version 12.63.1: May 22, 2013 Changing user's e-mail. (151625 lines)
|
Version 12.63.1: May 22, 2013 Changing user's email. (151625 lines)
|
||||||
Version 12.63: May 21, 2013 Option "Nickname" is changed to option "User's account". (151396 lines)
|
Version 12.63: May 21, 2013 Option "Nickname" is changed to option "User's account". (151396 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
RENAME TABLE nicknames TO usr_nicknames;
|
RENAME TABLE nicknames TO usr_nicknames;
|
||||||
|
@ -5105,7 +5115,7 @@ mv swad_data_protection.html data_protection/index.html
|
||||||
|
|
||||||
Version 11.72.6: Jul 11, 2012 The word "DNI" is changed to "ID (DNI/cédula/pasaporte) in Spanish. (134447 lines)
|
Version 11.72.6: Jul 11, 2012 The word "DNI" is changed to "ID (DNI/cédula/pasaporte) in Spanish. (134447 lines)
|
||||||
Version 11.72.5: Jul 09, 2012 The data protection clause is moved to an external file. (134445 lines)
|
Version 11.72.5: Jul 09, 2012 The data protection clause is moved to an external file. (134445 lines)
|
||||||
Version 11.72.4: Jul 09, 2012 Changes in configuration related with automatic sending of e-mail. (134601 lines)
|
Version 11.72.4: Jul 09, 2012 Changes in configuration related with automatic sending of email. (134601 lines)
|
||||||
Version 11.72.3: Jul 08, 2012 New statistics of forums of centres. (134595 lines)
|
Version 11.72.3: Jul 08, 2012 New statistics of forums of centres. (134595 lines)
|
||||||
Version 11.72.2: Jul 08, 2012 Fixed bug in forums. (134592 lines)
|
Version 11.72.2: Jul 08, 2012 Fixed bug in forums. (134592 lines)
|
||||||
Version 11.72.1: Jul 08, 2012 Fixed bug in list of countries. (134591 lines)
|
Version 11.72.1: Jul 08, 2012 Fixed bug in list of countries. (134591 lines)
|
||||||
|
@ -5278,7 +5288,7 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1051','es','N','Camb
|
||||||
Version 11.30.7: Jan 15, 2012 Several messages translated (still 39 messages to be translated). (125168 lines)
|
Version 11.30.7: Jan 15, 2012 Several messages translated (still 39 messages to be translated). (125168 lines)
|
||||||
Version 11.30.6: Jan 14, 2012 Several messages translated (still 53 messages to be translated).
|
Version 11.30.6: Jan 14, 2012 Several messages translated (still 53 messages to be translated).
|
||||||
Other minor changes. (124913 lines)
|
Other minor changes. (124913 lines)
|
||||||
Version 11.30.5: Jan 14, 2012 Pending notifications are sent by e-mail on refresh actions. (124802 lines)
|
Version 11.30.5: Jan 14, 2012 Pending notifications are sent by email on refresh actions. (124802 lines)
|
||||||
Version 11.30.4: Jan 14, 2012 When a user is removed from a course or from a group, it is better not to set notifications as inaccessible because the user can be enrolled again. (124802 lines)
|
Version 11.30.4: Jan 14, 2012 When a user is removed from a course or from a group, it is better not to set notifications as inaccessible because the user can be enrolled again. (124802 lines)
|
||||||
Version 11.30.3: Jan 14, 2012 When a course is removed, the notifications in that course are set as removed.
|
Version 11.30.3: Jan 14, 2012 When a course is removed, the notifications in that course are set as removed.
|
||||||
When a user is removed from a course or from a group, the notifications inaccessible are set as inaccessible. (124842 lines)
|
When a user is removed from a course or from a group, the notifications inaccessible are set as inaccessible. (124842 lines)
|
||||||
|
|
|
@ -66,10 +66,10 @@
|
||||||
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
||||||
|
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_NAME "Antonio Cañas Vargas" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_NAME "Antonio Cañas Vargas" // Main responsible for the platform
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_E_MAIL "webmaster@openswad.org" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_EMAIL "webmaster@openswad.org" // Main responsible for the platform
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "openswad.org" // SMTP server for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "openswad.org" // SMTP server for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // E-mail address from where automatic e-mails will be sent
|
#define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // Email address from where automatic emails will be sent
|
||||||
#define Cfg_DATABASE_HOST "localhost" // Database host
|
#define Cfg_DATABASE_HOST "localhost" // Database host
|
||||||
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language
|
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language
|
||||||
#define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database
|
#define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
||||||
|
|
||||||
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(30UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by e-mail
|
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(30UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by email
|
||||||
|
|
||||||
#define Cfg_GOOGLE_ANALYTICS ""
|
#define Cfg_GOOGLE_ANALYTICS ""
|
||||||
|
|
||||||
|
@ -107,10 +107,10 @@
|
||||||
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
||||||
|
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_NAME "Antonio Cañas Vargas" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_NAME "Antonio Cañas Vargas" // Main responsible for the platform
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_E_MAIL "webmaster@openswad.org" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_EMAIL "webmaster@openswad.org" // Main responsible for the platform
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "mail.openswad.org" // SMTP server for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "mail.openswad.org" // SMTP server for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // E-mail address from where automatic e-mails will be sent
|
#define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // Email address from where automatic emails will be sent
|
||||||
#define Cfg_DATABASE_HOST "localhost" // Database host
|
#define Cfg_DATABASE_HOST "localhost" // Database host
|
||||||
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_EN // Default language
|
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_EN // Default language
|
||||||
#define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database
|
#define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
|
|
||||||
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
||||||
|
|
||||||
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(30UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by e-mail
|
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(30UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by email
|
||||||
|
|
||||||
/* Google Analytics without cookies.
|
/* Google Analytics without cookies.
|
||||||
* This code comes from http://stackoverflow.com/a/19995629
|
* This code comes from http://stackoverflow.com/a/19995629
|
||||||
|
@ -165,10 +165,10 @@
|
||||||
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
||||||
|
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_NAME "UGR" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_NAME "UGR" // Main responsible for the platform
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_E_MAIL "swad@ugr.es" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_EMAIL "swad@ugr.es" // Main responsible for the platform
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "smtp.ugr.es" // SMTP server for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "smtp.ugr.es" // SMTP server for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // E-mail address from where automatic e-mails will be sent
|
#define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // Email address from where automatic emails will be sent
|
||||||
#define Cfg_DATABASE_HOST "localhost" // Database host
|
#define Cfg_DATABASE_HOST "localhost" // Database host
|
||||||
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language
|
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language
|
||||||
#define Cfg_LOG_START_YEAR 2005 // Year when the log started in the database
|
#define Cfg_LOG_START_YEAR 2005 // Year when the log started in the database
|
||||||
|
@ -182,7 +182,7 @@
|
||||||
|
|
||||||
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
||||||
|
|
||||||
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(60UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by e-mail
|
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(60UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by email
|
||||||
|
|
||||||
#define Cfg_GOOGLE_ANALYTICS "<script type=\"text/javascript\">" \
|
#define Cfg_GOOGLE_ANALYTICS "<script type=\"text/javascript\">" \
|
||||||
" (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){" \
|
" (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){" \
|
||||||
|
@ -220,10 +220,10 @@
|
||||||
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
#define Cfg_PLATFORM_LOGO_BIG_HEIGHT 40
|
||||||
|
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_NAME "ATC - UGR" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_NAME "ATC - UGR" // Main responsible for the platform
|
||||||
#define Cfg_PLATFORM_RESPONSIBLE_E_MAIL "swad@ugr.es" // Main responsible for the platform
|
#define Cfg_PLATFORM_RESPONSIBLE_EMAIL "swad@ugr.es" // Main responsible for the platform
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "smtp.ugr.es" // SMTP server for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_SERVER "smtp.ugr.es" // SMTP server for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic emails
|
||||||
#define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // E-mail address from where automatic e-mails will be sent
|
#define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // Email address from where automatic emails will be sent
|
||||||
#define Cfg_DATABASE_HOST "localhost" // Database host
|
#define Cfg_DATABASE_HOST "localhost" // Database host
|
||||||
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language
|
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language
|
||||||
#define Cfg_LOG_START_YEAR 2016 // Year when the log started in the database
|
#define Cfg_LOG_START_YEAR 2016 // Year when the log started in the database
|
||||||
|
@ -237,7 +237,7 @@
|
||||||
|
|
||||||
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
#define Cfg_DEFAULT_COLUMNS Lay_SHOW_BOTH_COLUMNS
|
||||||
|
|
||||||
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(30UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by e-mail
|
#define Cfg_TIME_TO_SEND_PENDING_NOTIF ((time_t)(30UL*60UL)) // After these seconds after first pending notification, all the pending notifications are sent by email
|
||||||
|
|
||||||
#define Cfg_GOOGLE_ANALYTICS ""
|
#define Cfg_GOOGLE_ANALYTICS ""
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@
|
||||||
#define Cfg_DATABASE_USER "swad" // Database user
|
#define Cfg_DATABASE_USER "swad" // Database user
|
||||||
|
|
||||||
/* Email */
|
/* Email */
|
||||||
#define Cfg_AUTOMATIC_EMAIL_PASSWORD DONT_PUBLISH_SMTP_PASSWORD // E-mail user's password for automatic e-mails
|
#define Cfg_AUTOMATIC_EMAIL_PASSWORD DONT_PUBLISH_SMTP_PASSWORD // Email user's password for automatic emails
|
||||||
|
|
||||||
/* About SWAD */
|
/* About SWAD */
|
||||||
#define Cfg_ABOUT_SWAD_URL "http://openswad.org/info/"
|
#define Cfg_ABOUT_SWAD_URL "http://openswad.org/info/"
|
||||||
|
@ -436,8 +436,8 @@
|
||||||
#define Cfg_COMMAND_DEGREE_PHOTO_MEDIAN "./foto_mediana"
|
#define Cfg_COMMAND_DEGREE_PHOTO_MEDIAN "./foto_mediana"
|
||||||
#define Cfg_COMMAND_DEGREE_PHOTO_AVERAGE "./foto_promedio"
|
#define Cfg_COMMAND_DEGREE_PHOTO_AVERAGE "./foto_promedio"
|
||||||
|
|
||||||
/* Command to send automatic e-mails, programmed by Antonio F. Díaz-García and Antonio Cañas-Vargas */
|
/* Command to send automatic emails, programmed by Antonio F. Díaz-García and Antonio Cañas-Vargas */
|
||||||
#define Cfg_COMMAND_SEND_AUTOMATIC_E_MAIL "./swad_smtp.py"
|
#define Cfg_COMMAND_SEND_AUTOMATIC_EMAIL "./swad_smtp.py"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************************** Time periods *******************************/
|
/******************************** Time periods *******************************/
|
||||||
|
|
|
@ -195,7 +195,7 @@ void Enr_ModifyRoleInCurrentCrs (struct UsrData *UsrDat,
|
||||||
DB_QueryUPDATE (Query,"can not modify user's role in course");
|
DB_QueryUPDATE (Query,"can not modify user's role in course");
|
||||||
|
|
||||||
/***** Create notification for this user.
|
/***** Create notification for this user.
|
||||||
If this user wants to receive notifications by e-mail,
|
If this user wants to receive notifications by email,
|
||||||
activate the sending of a notification *****/
|
activate the sending of a notification *****/
|
||||||
Enr_NotifyAfterEnrollment (UsrDat,NewRole);
|
Enr_NotifyAfterEnrollment (UsrDat,NewRole);
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
|
||||||
UsrDat->Roles |= NewRole;
|
UsrDat->Roles |= NewRole;
|
||||||
|
|
||||||
/***** Create notification for this user.
|
/***** Create notification for this user.
|
||||||
If this user wants to receive notifications by e-mail,
|
If this user wants to receive notifications by email,
|
||||||
activate the sending of a notification *****/
|
activate the sending of a notification *****/
|
||||||
Enr_NotifyAfterEnrollment (UsrDat,NewRole);
|
Enr_NotifyAfterEnrollment (UsrDat,NewRole);
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ static void Enr_NotifyAfterEnrollment (struct UsrData *UsrDat,Rol_Role_t NewRole
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****** Write a form to request another user's ID, @nickname or e-mail *******/
|
/****** Write a form to request another user's ID, @nickname or email *******/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction)
|
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction)
|
||||||
|
@ -323,7 +323,7 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction)
|
||||||
extern const char *Txt_nick_email_or_ID;
|
extern const char *Txt_nick_email_or_ID;
|
||||||
extern const char *Txt_Continue;
|
extern const char *Txt_Continue;
|
||||||
|
|
||||||
/***** Form to request user's ID, @nickname or e-mail address *****/
|
/***** Form to request user's ID, @nickname or email address *****/
|
||||||
Act_FormStart (NextAction);
|
Act_FormStart (NextAction);
|
||||||
fprintf (Gbl.F.Out,"<label class=\"%s RIGHT_MIDDLE\">"
|
fprintf (Gbl.F.Out,"<label class=\"%s RIGHT_MIDDLE\">"
|
||||||
"%s: "
|
"%s: "
|
||||||
|
@ -1368,7 +1368,7 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
|
||||||
ListUsrCods.NumUsrs = 0;
|
ListUsrCods.NumUsrs = 0;
|
||||||
ListUsrCods.Lst = NULL;
|
ListUsrCods.Lst = NULL;
|
||||||
|
|
||||||
/* Check if string is a user's ID, user's nickname or user's e-mail address */
|
/* Check if string is a user's ID, user's nickname or user's email address */
|
||||||
if (Nck_CheckIfNickWithArrobaIsValid (UsrDat.UsrIDNickOrEmail)) // 1: It's a nickname
|
if (Nck_CheckIfNickWithArrobaIsValid (UsrDat.UsrIDNickOrEmail)) // 1: It's a nickname
|
||||||
{
|
{
|
||||||
if ((UsrDat.UsrCod = Nck_GetUsrCodFromNickname (UsrDat.UsrIDNickOrEmail)) > 0)
|
if ((UsrDat.UsrCod = Nck_GetUsrCodFromNickname (UsrDat.UsrIDNickOrEmail)) > 0)
|
||||||
|
@ -1378,7 +1378,7 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
|
||||||
ListUsrCods.Lst[0] = UsrDat.UsrCod;
|
ListUsrCods.Lst[0] = UsrDat.UsrCod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (UsrDat.UsrIDNickOrEmail)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (UsrDat.UsrIDNickOrEmail)) // 2: It's an email
|
||||||
{
|
{
|
||||||
if ((UsrDat.UsrCod = Mai_GetUsrCodFromEmail (UsrDat.UsrIDNickOrEmail)) > 0)
|
if ((UsrDat.UsrCod = Mai_GetUsrCodFromEmail (UsrDat.UsrIDNickOrEmail)) > 0)
|
||||||
{
|
{
|
||||||
|
@ -1489,7 +1489,7 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
|
||||||
ListUsrCods.NumUsrs = 0;
|
ListUsrCods.NumUsrs = 0;
|
||||||
ListUsrCods.Lst = NULL;
|
ListUsrCods.Lst = NULL;
|
||||||
|
|
||||||
/* Check if the string is a user's ID, a user's nickname or a user's e-mail address */
|
/* Check if the string is a user's ID, a user's nickname or a user's email address */
|
||||||
if (Nck_CheckIfNickWithArrobaIsValid (UsrDat.UsrIDNickOrEmail)) // 1: It's a nickname
|
if (Nck_CheckIfNickWithArrobaIsValid (UsrDat.UsrIDNickOrEmail)) // 1: It's a nickname
|
||||||
{
|
{
|
||||||
if ((UsrDat.UsrCod = Nck_GetUsrCodFromNickname (UsrDat.UsrIDNickOrEmail)) > 0)
|
if ((UsrDat.UsrCod = Nck_GetUsrCodFromNickname (UsrDat.UsrIDNickOrEmail)) > 0)
|
||||||
|
@ -1499,7 +1499,7 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
|
||||||
ListUsrCods.Lst[0] = UsrDat.UsrCod;
|
ListUsrCods.Lst[0] = UsrDat.UsrCod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (UsrDat.UsrIDNickOrEmail)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (UsrDat.UsrIDNickOrEmail)) // 2: It's an email
|
||||||
{
|
{
|
||||||
if ((UsrDat.UsrCod = Mai_GetUsrCodFromEmail (UsrDat.UsrIDNickOrEmail)) > 0)
|
if ((UsrDat.UsrCod = Mai_GetUsrCodFromEmail (UsrDat.UsrIDNickOrEmail)) > 0)
|
||||||
{
|
{
|
||||||
|
@ -1863,7 +1863,7 @@ void Enr_SignUpInCrs (void)
|
||||||
Gbl.CurrentCrs.Crs.FullName);
|
Gbl.CurrentCrs.Crs.FullName);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||||
|
|
||||||
/***** Notify teachers or admins by e-mail about the new enrollment request *****/
|
/***** Notify teachers or admins by email about the new enrollment request *****/
|
||||||
// If this course has teachers ==> send notification to teachers
|
// If this course has teachers ==> send notification to teachers
|
||||||
// If this course has no teachers and I want to be a teacher ==> send notification to administrators or superusers
|
// If this course has no teachers and I want to be a teacher ==> send notification to administrators or superusers
|
||||||
if (Gbl.CurrentCrs.Crs.NumTchs || RoleFromForm == Rol_TEACHER)
|
if (Gbl.CurrentCrs.Crs.NumTchs || RoleFromForm == Rol_TEACHER)
|
||||||
|
@ -2905,7 +2905,7 @@ static bool Enr_CheckIfICanAdminOtherUsrs (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****** Write a form to request another user's ID, @nickname or e-mail *******/
|
/****** Write a form to request another user's ID, @nickname or email ********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Enr_ReqAnotherUsrIDToRegisterRemove (Rol_Role_t Role)
|
static void Enr_ReqAnotherUsrIDToRegisterRemove (Rol_Role_t Role)
|
||||||
|
@ -3104,7 +3104,7 @@ static void Enr_ShowFormToEditOtherUsr (void)
|
||||||
if (Pwd_CheckIfICanChangeOtherUsrPassword (Gbl.Usrs.Other.UsrDat.UsrCod))
|
if (Pwd_CheckIfICanChangeOtherUsrPassword (Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||||
{
|
{
|
||||||
Pwd_PutLinkToChangeOtherUsrPassword (); // Put link (form) to change user's password
|
Pwd_PutLinkToChangeOtherUsrPassword (); // Put link (form) to change user's password
|
||||||
Mai_PutLinkToChangeOtherUsrEmail (); // Put link (form) to change user's e-mail
|
Mai_PutLinkToChangeOtherUsrEmail (); // Put link (form) to change user's email
|
||||||
ID_PutLinkToChangeUsrIDs (); // Put link (form) to change user's IDs
|
ID_PutLinkToChangeUsrIDs (); // Put link (form) to change user's IDs
|
||||||
}
|
}
|
||||||
if (Pho_CheckIfICanChangeOtherUsrPhoto (&Gbl.Usrs.Other.UsrDat))
|
if (Pho_CheckIfICanChangeOtherUsrPhoto (&Gbl.Usrs.Other.UsrDat))
|
||||||
|
|
|
@ -306,7 +306,7 @@ void Exa_ReceiveExamAnnouncement (void)
|
||||||
Lay_ShowAlert (Lay_SUCCESS,NewExamAnnouncement ? Txt_Created_new_announcement_of_exam :
|
Lay_ShowAlert (Lay_SUCCESS,NewExamAnnouncement ? Txt_Created_new_announcement_of_exam :
|
||||||
Txt_The_announcement_of_exam_has_been_successfully_updated);
|
Txt_The_announcement_of_exam_has_been_successfully_updated);
|
||||||
|
|
||||||
/***** Notify by e-mail about the new exam announcement *****/
|
/***** Notify by email about the new exam announcement *****/
|
||||||
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_EXAM_ANNOUNCEMENT,ExaCod)))
|
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_EXAM_ANNOUNCEMENT,ExaCod)))
|
||||||
Exa_UpdateNumUsrsNotifiedByEMailAboutExamAnnouncement (ExaCod,NumUsrsToBeNotifiedByEMail);
|
Exa_UpdateNumUsrsNotifiedByEMailAboutExamAnnouncement (ExaCod,NumUsrsToBeNotifiedByEMail);
|
||||||
Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (NumUsrsToBeNotifiedByEMail);
|
Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (NumUsrsToBeNotifiedByEMail);
|
||||||
|
|
|
@ -3399,7 +3399,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat)
|
||||||
fprintf (Gbl.F.Out,", %s",UsrDat->FirstName);
|
fprintf (Gbl.F.Out,", %s",UsrDat->FirstName);
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
|
||||||
/***** Show user's e-mail *****/
|
/***** Show user's email *****/
|
||||||
if (UsrDat->Email[0])
|
if (UsrDat->Email[0])
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<br />"
|
fprintf (Gbl.F.Out,"<br />"
|
||||||
|
@ -3464,7 +3464,7 @@ void Brw_ShowAgainFileBrowserOrWorks (void)
|
||||||
/***** Legal notice *****/
|
/***** Legal notice *****/
|
||||||
sprintf (Gbl.Message,Txt_Disclaimer_the_files_hosted_here_,
|
sprintf (Gbl.Message,Txt_Disclaimer_the_files_hosted_here_,
|
||||||
Cfg_PLATFORM_SHORT_NAME,
|
Cfg_PLATFORM_SHORT_NAME,
|
||||||
Cfg_PLATFORM_RESPONSIBLE_E_MAIL);
|
Cfg_PLATFORM_RESPONSIBLE_EMAIL);
|
||||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -786,13 +786,13 @@ void Fol_FollowUsr (void)
|
||||||
Gbl.Usrs.Other.UsrDat.UsrCod);
|
Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||||
DB_QueryREPLACE (Query,"can not follow user");
|
DB_QueryREPLACE (Query,"can not follow user");
|
||||||
|
|
||||||
/***** This follow must be notified by e-mail? *****/
|
/***** This follow must be notified by email? *****/
|
||||||
CreateNotif = (Gbl.Usrs.Other.UsrDat.Prefs.NotifNtfEvents & (1 << Ntf_EVENT_FOLLOWER));
|
CreateNotif = (Gbl.Usrs.Other.UsrDat.Prefs.NotifNtfEvents & (1 << Ntf_EVENT_FOLLOWER));
|
||||||
NotifyByEmail = CreateNotif &&
|
NotifyByEmail = CreateNotif &&
|
||||||
(Gbl.Usrs.Other.UsrDat.Prefs.EmailNtfEvents & (1 << Ntf_EVENT_FOLLOWER));
|
(Gbl.Usrs.Other.UsrDat.Prefs.EmailNtfEvents & (1 << Ntf_EVENT_FOLLOWER));
|
||||||
|
|
||||||
/***** Create notification for this followed.
|
/***** Create notification for this followed.
|
||||||
If this followed wants to receive notifications by e-mail, activate the sending of a notification *****/
|
If this followed wants to receive notifications by email, activate the sending of a notification *****/
|
||||||
if (CreateNotif)
|
if (CreateNotif)
|
||||||
Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_FOLLOWER,&Gbl.Usrs.Other.UsrDat,Gbl.Usrs.Me.UsrDat.UsrCod,
|
Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_FOLLOWER,&Gbl.Usrs.Other.UsrDat,Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
|
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
|
||||||
|
|
|
@ -173,7 +173,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Usrs.Me.MyDegs.Filled = false;
|
Gbl.Usrs.Me.MyDegs.Filled = false;
|
||||||
Gbl.Usrs.Me.MyCrss.Filled = false;
|
Gbl.Usrs.Me.MyCrss.Filled = false;
|
||||||
Gbl.Usrs.Me.MyCrss.Num = 0;
|
Gbl.Usrs.Me.MyCrss.Num = 0;
|
||||||
Gbl.Usrs.Me.ConfirmEmailJustSent = false; // An e-mail to confirm my e-mail address has not just been sent
|
Gbl.Usrs.Me.ConfirmEmailJustSent = false; // An email to confirm my email address has not just been sent
|
||||||
|
|
||||||
Gbl.Usrs.Other.UsrDat.UsrCod = -1L;
|
Gbl.Usrs.Other.UsrDat.UsrCod = -1L;
|
||||||
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0] = '\0';
|
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0] = '\0';
|
||||||
|
|
|
@ -287,7 +287,7 @@ struct Globals
|
||||||
Rol_Role_t LoggedRoleBeforeCloseSession;
|
Rol_Role_t LoggedRoleBeforeCloseSession;
|
||||||
Rol_Role_t MaxRole;
|
Rol_Role_t MaxRole;
|
||||||
bool RoleHasChanged; // Set when I have changed my role
|
bool RoleHasChanged; // Set when I have changed my role
|
||||||
char UsrIdLogin[Usr_MAX_BYTES_USR_LOGIN+1]; // String to store the ID, nickname or e-mail entered in the user's login
|
char UsrIdLogin[Usr_MAX_BYTES_USR_LOGIN+1]; // String to store the ID, nickname or email entered in the user's login
|
||||||
char LoginPlainPassword[Pwd_MAX_LENGTH_PLAIN_PASSWORD+1];
|
char LoginPlainPassword[Pwd_MAX_LENGTH_PLAIN_PASSWORD+1];
|
||||||
char LoginEncryptedPassword[Cry_LENGTH_ENCRYPTED_STR_SHA512_BASE64+1];
|
char LoginEncryptedPassword[Cry_LENGTH_ENCRYPTED_STR_SHA512_BASE64+1];
|
||||||
char PendingPassword[Cry_LENGTH_ENCRYPTED_STR_SHA512_BASE64+1];
|
char PendingPassword[Cry_LENGTH_ENCRYPTED_STR_SHA512_BASE64+1];
|
||||||
|
@ -301,7 +301,7 @@ struct Globals
|
||||||
unsigned NumAccWithoutPhoto;
|
unsigned NumAccWithoutPhoto;
|
||||||
char PhotoURL[PATH_MAX+1];
|
char PhotoURL[PATH_MAX+1];
|
||||||
time_t TimeLastAccToThisFileBrowser;
|
time_t TimeLastAccToThisFileBrowser;
|
||||||
bool ConfirmEmailJustSent; // An e-mail to confirm my e-mail address has just been sent
|
bool ConfirmEmailJustSent; // An email to confirm my email address has just been sent
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool Filled; // My institutions are already filled?
|
bool Filled; // My institutions are already filled?
|
||||||
|
|
|
@ -1478,7 +1478,7 @@ static void Lay_WriteAboutZone (void)
|
||||||
"<a href=\"mailto:%s\" class=\"ABOUT\" target=\"_blank\">%s</a>"
|
"<a href=\"mailto:%s\" class=\"ABOUT\" target=\"_blank\">%s</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Txt_Questions_and_problems,
|
Txt_Questions_and_problems,
|
||||||
Cfg_PLATFORM_RESPONSIBLE_E_MAIL,Cfg_PLATFORM_RESPONSIBLE_E_MAIL);
|
Cfg_PLATFORM_RESPONSIBLE_EMAIL,Cfg_PLATFORM_RESPONSIBLE_EMAIL);
|
||||||
|
|
||||||
/***** About and time to generate and send page *****/
|
/***** About and time to generate and send page *****/
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
fprintf (Gbl.F.Out,"<div>");
|
||||||
|
@ -1511,7 +1511,7 @@ void Lay_RefreshNotifsAndConnected (void)
|
||||||
|
|
||||||
// Sometimes, someone must do this work, so who best than processes that refresh via AJAX?
|
// Sometimes, someone must do this work, so who best than processes that refresh via AJAX?
|
||||||
if (!(Gbl.PID % 11)) // Do this only one of 11 times ( 11 is prime)
|
if (!(Gbl.PID % 11)) // Do this only one of 11 times ( 11 is prime)
|
||||||
Ntf_SendPendingNotifByEMailToAllUsrs (); // Send pending notifications by e-mail
|
Ntf_SendPendingNotifByEMailToAllUsrs (); // Send pending notifications by email
|
||||||
else if (!(Gbl.PID % 1013)) // Do this only one of 1013 times (1013 is prime)
|
else if (!(Gbl.PID % 1013)) // Do this only one of 1013 times (1013 is prime)
|
||||||
Brw_RemoveExpiredExpandedFolders (); // Remove old expanded folders (from all users)
|
Brw_RemoveExpiredExpandedFolders (); // Remove old expanded folders (from all users)
|
||||||
else if (!(Gbl.PID % 1019)) // Do this only one of 1019 times (1019 is prime)
|
else if (!(Gbl.PID % 1019)) // Do this only one of 1019 times (1019 is prime)
|
||||||
|
|
302
swad_mail.c
302
swad_mail.c
|
@ -1,4 +1,4 @@
|
||||||
// swad_mail.c: all the stuff related to e-mail
|
// swad_mail.c: all the stuff related to email
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SWAD (Shared Workspace At a Distance),
|
SWAD (Shared Workspace At a Distance),
|
||||||
|
@ -88,9 +88,9 @@ static void Mai_InsertMailKey (const char *Email,const char MailKey[Mai_LENGTH_E
|
||||||
|
|
||||||
void Mai_SeeMailDomains (void)
|
void Mai_SeeMailDomains (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Mail_domains_allowed_for_notifications;
|
extern const char *Txt_Email_domains_allowed_for_notifications;
|
||||||
extern const char *Txt_MAIL_DOMAIN_HELP_ORDER[3];
|
extern const char *Txt_EMAIL_DOMAIN_HELP_ORDER[3];
|
||||||
extern const char *Txt_MAIL_DOMAIN_ORDER[3];
|
extern const char *Txt_EMAIL_DOMAIN_ORDER[3];
|
||||||
Mai_MailDomainsOrderType_t Order;
|
Mai_MailDomainsOrderType_t Order;
|
||||||
unsigned NumMai;
|
unsigned NumMai;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ void Mai_SeeMailDomains (void)
|
||||||
Mai_GetListMailDomainsAllowedForNotif ();
|
Mai_GetListMailDomainsAllowedForNotif ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
Lay_StartRoundFrameTable (NULL,Txt_Mail_domains_allowed_for_notifications,
|
Lay_StartRoundFrameTable (NULL,Txt_Email_domains_allowed_for_notifications,
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM ? Mai_PutIconToEditMailDomains :
|
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM ? Mai_PutIconToEditMailDomains :
|
||||||
NULL,
|
NULL,
|
||||||
NULL,2);
|
NULL,2);
|
||||||
|
@ -113,10 +113,10 @@ void Mai_SeeMailDomains (void)
|
||||||
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">");
|
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">");
|
||||||
Act_FormStart (ActSeeMai);
|
Act_FormStart (ActSeeMai);
|
||||||
Par_PutHiddenParamUnsigned ("Order",(unsigned) Order);
|
Par_PutHiddenParamUnsigned ("Order",(unsigned) Order);
|
||||||
Act_LinkFormSubmit (Txt_MAIL_DOMAIN_HELP_ORDER[Order],"TIT_TBL",NULL);
|
Act_LinkFormSubmit (Txt_EMAIL_DOMAIN_HELP_ORDER[Order],"TIT_TBL",NULL);
|
||||||
if (Order == Gbl.Mails.SelectedOrderType)
|
if (Order == Gbl.Mails.SelectedOrderType)
|
||||||
fprintf (Gbl.F.Out,"<u>");
|
fprintf (Gbl.F.Out,"<u>");
|
||||||
fprintf (Gbl.F.Out,"%s",Txt_MAIL_DOMAIN_ORDER[Order]);
|
fprintf (Gbl.F.Out,"%s",Txt_EMAIL_DOMAIN_ORDER[Order]);
|
||||||
if (Order == Gbl.Mails.SelectedOrderType)
|
if (Order == Gbl.Mails.SelectedOrderType)
|
||||||
fprintf (Gbl.F.Out,"</u>");
|
fprintf (Gbl.F.Out,"</u>");
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
@ -188,14 +188,14 @@ static void Mai_PutIconToEditMailDomains (void)
|
||||||
|
|
||||||
void Mai_EditMailDomains (void)
|
void Mai_EditMailDomains (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_There_are_no_mail_domains;
|
extern const char *Txt_There_are_no_email_domains;
|
||||||
|
|
||||||
/***** Get list of mail domains *****/
|
/***** Get list of mail domains *****/
|
||||||
Mai_GetListMailDomainsAllowedForNotif ();
|
Mai_GetListMailDomainsAllowedForNotif ();
|
||||||
|
|
||||||
if (!Gbl.Mails.Num)
|
if (!Gbl.Mails.Num)
|
||||||
/***** Help message *****/
|
/***** Help message *****/
|
||||||
Lay_ShowAlert (Lay_INFO,Txt_There_are_no_mail_domains);
|
Lay_ShowAlert (Lay_INFO,Txt_There_are_no_email_domains);
|
||||||
|
|
||||||
/***** Put a form to create a new mail *****/
|
/***** Put a form to create a new mail *****/
|
||||||
Mai_PutFormToCreateMailDomain ();
|
Mai_PutFormToCreateMailDomain ();
|
||||||
|
@ -310,14 +310,14 @@ static void Mai_GetListMailDomainsAllowedForNotif (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************ Check if user can receive notifications via e-mail *************/
|
/************ Check if user can receive notifications via email **************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct UsrData *UsrDat)
|
bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct UsrData *UsrDat)
|
||||||
{
|
{
|
||||||
char MailDomain[Usr_MAX_BYTES_USR_EMAIL+1];
|
char MailDomain[Usr_MAX_BYTES_USR_EMAIL+1];
|
||||||
|
|
||||||
/***** Check #1: is my e-mail address confirmed? *****/
|
/***** Check #1: is my email address confirmed? *****/
|
||||||
if (!UsrDat->EmailConfirmed)
|
if (!UsrDat->EmailConfirmed)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ static bool Mai_CheckIfMailDomainIsAllowedForNotif (const char *MailDomain)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Show warning about notifications via e-mail ***************/
|
/***************** Show warning about notifications via email ****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_WriteWarningEmailNotifications (void)
|
void Mai_WriteWarningEmailNotifications (void)
|
||||||
|
@ -423,11 +423,11 @@ void Mai_FreeListMailDomains (void)
|
||||||
|
|
||||||
static void Mai_ListMailDomainsForEdition (void)
|
static void Mai_ListMailDomainsForEdition (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Mail_domains_allowed_for_notifications;
|
extern const char *Txt_Email_domains_allowed_for_notifications;
|
||||||
unsigned NumMai;
|
unsigned NumMai;
|
||||||
struct Mail *Mai;
|
struct Mail *Mai;
|
||||||
|
|
||||||
Lay_StartRoundFrameTable (NULL,Txt_Mail_domains_allowed_for_notifications,
|
Lay_StartRoundFrameTable (NULL,Txt_Email_domains_allowed_for_notifications,
|
||||||
NULL,NULL,2);
|
NULL,NULL,2);
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
@ -518,7 +518,7 @@ long Mai_GetParamMaiCod (void)
|
||||||
|
|
||||||
void Mai_RemoveMailDomain (void)
|
void Mai_RemoveMailDomain (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Mail_domain_X_removed;
|
extern const char *Txt_Email_domain_X_removed;
|
||||||
char Query[512];
|
char Query[512];
|
||||||
struct Mail Mai;
|
struct Mail Mai;
|
||||||
|
|
||||||
|
@ -534,7 +534,7 @@ void Mai_RemoveMailDomain (void)
|
||||||
DB_QueryDELETE (Query,"can not remove a mail domain");
|
DB_QueryDELETE (Query,"can not remove a mail domain");
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
sprintf (Gbl.Message,Txt_Mail_domain_X_removed,
|
sprintf (Gbl.Message,Txt_Email_domain_X_removed,
|
||||||
Mai.Domain);
|
Mai.Domain);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||||
|
|
||||||
|
@ -566,10 +566,10 @@ void Mai_RenameMailDomainFull (void)
|
||||||
|
|
||||||
static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
|
static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
{
|
{
|
||||||
extern const char *Txt_You_can_not_leave_the_name_of_the_mail_domain_X_empty;
|
extern const char *Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty;
|
||||||
extern const char *Txt_The_mail_domain_X_already_exists;
|
extern const char *Txt_The_email_domain_X_already_exists;
|
||||||
extern const char *Txt_The_mail_domain_X_has_been_renamed_as_Y;
|
extern const char *Txt_The_email_domain_X_has_been_renamed_as_Y;
|
||||||
extern const char *Txt_The_mail_domain_X_has_not_changed;
|
extern const char *Txt_The_email_domain_X_has_not_changed;
|
||||||
char Query[512];
|
char Query[512];
|
||||||
struct Mail *Mai;
|
struct Mail *Mai;
|
||||||
const char *ParamName = NULL; // Initialized to avoid warning
|
const char *ParamName = NULL; // Initialized to avoid warning
|
||||||
|
@ -609,7 +609,7 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
/***** Check if new name is empty *****/
|
/***** Check if new name is empty *****/
|
||||||
if (!NewMaiName[0])
|
if (!NewMaiName[0])
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_mail_domain_X_empty,
|
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty,
|
||||||
CurrentMaiName);
|
CurrentMaiName);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
@ -621,7 +621,7 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
/***** If mail was in database... *****/
|
/***** If mail was in database... *****/
|
||||||
if (Mai_CheckIfMailDomainNameExists (ParamName,NewMaiName,Mai->MaiCod))
|
if (Mai_CheckIfMailDomainNameExists (ParamName,NewMaiName,Mai->MaiCod))
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_The_mail_domain_X_already_exists,
|
sprintf (Gbl.Message,Txt_The_email_domain_X_already_exists,
|
||||||
NewMaiName);
|
NewMaiName);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
@ -633,14 +633,14 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
DB_QueryUPDATE (Query,"can not update the name of a mail domain");
|
DB_QueryUPDATE (Query,"can not update the name of a mail domain");
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
sprintf (Gbl.Message,Txt_The_mail_domain_X_has_been_renamed_as_Y,
|
sprintf (Gbl.Message,Txt_The_email_domain_X_has_been_renamed_as_Y,
|
||||||
CurrentMaiName,NewMaiName);
|
CurrentMaiName,NewMaiName);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // The same name
|
else // The same name
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_The_mail_domain_X_has_not_changed,
|
sprintf (Gbl.Message,Txt_The_email_domain_X_has_not_changed,
|
||||||
CurrentMaiName);
|
CurrentMaiName);
|
||||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
@ -671,9 +671,9 @@ static bool Mai_CheckIfMailDomainNameExists (const char *FieldName,const char *N
|
||||||
|
|
||||||
static void Mai_PutFormToCreateMailDomain (void)
|
static void Mai_PutFormToCreateMailDomain (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_New_mail_domain;
|
extern const char *Txt_New_email_domain;
|
||||||
extern const char *Txt_MAIL_DOMAIN_ORDER[3];
|
extern const char *Txt_EMAIL_DOMAIN_ORDER[3];
|
||||||
extern const char *Txt_Create_mail_domain;
|
extern const char *Txt_Create_email_domain;
|
||||||
struct Mail *Mai;
|
struct Mail *Mai;
|
||||||
|
|
||||||
Mai = &Gbl.Mails.EditingMai;
|
Mai = &Gbl.Mails.EditingMai;
|
||||||
|
@ -682,7 +682,7 @@ static void Mai_PutFormToCreateMailDomain (void)
|
||||||
Act_FormStart (ActNewMai);
|
Act_FormStart (ActNewMai);
|
||||||
|
|
||||||
/***** Start of frame *****/
|
/***** Start of frame *****/
|
||||||
Lay_StartRoundFrameTable (NULL,Txt_New_mail_domain,NULL,NULL,2);
|
Lay_StartRoundFrameTable (NULL,Txt_New_email_domain,NULL,NULL,2);
|
||||||
|
|
||||||
/***** Write heading *****/
|
/***** Write heading *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
@ -693,8 +693,8 @@ static void Mai_PutFormToCreateMailDomain (void)
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_MAIL_DOMAIN_ORDER[Mai_ORDER_BY_DOMAIN],
|
Txt_EMAIL_DOMAIN_ORDER[Mai_ORDER_BY_DOMAIN],
|
||||||
Txt_MAIL_DOMAIN_ORDER[Mai_ORDER_BY_INFO ]);
|
Txt_EMAIL_DOMAIN_ORDER[Mai_ORDER_BY_INFO ]);
|
||||||
|
|
||||||
/***** Mail domain *****/
|
/***** Mail domain *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
@ -715,7 +715,7 @@ static void Mai_PutFormToCreateMailDomain (void)
|
||||||
|
|
||||||
|
|
||||||
/***** Send button and end frame *****/
|
/***** Send button and end frame *****/
|
||||||
Lay_EndRoundFrameTableWithButton (Lay_CREATE_BUTTON,Txt_Create_mail_domain);
|
Lay_EndRoundFrameTableWithButton (Lay_CREATE_BUTTON,Txt_Create_email_domain);
|
||||||
|
|
||||||
/***** End of form *****/
|
/***** End of form *****/
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
|
@ -728,7 +728,7 @@ static void Mai_PutFormToCreateMailDomain (void)
|
||||||
static void Mai_PutHeadMailDomains (void)
|
static void Mai_PutHeadMailDomains (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Code;
|
extern const char *Txt_Code;
|
||||||
extern const char *Txt_MAIL_DOMAIN_ORDER[3];
|
extern const char *Txt_EMAIL_DOMAIN_ORDER[3];
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<th class=\"BM\"></th>"
|
"<th class=\"BM\"></th>"
|
||||||
|
@ -746,9 +746,9 @@ static void Mai_PutHeadMailDomains (void)
|
||||||
"</th>"
|
"</th>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Code,
|
Txt_Code,
|
||||||
Txt_MAIL_DOMAIN_ORDER[Mai_ORDER_BY_DOMAIN],
|
Txt_EMAIL_DOMAIN_ORDER[Mai_ORDER_BY_DOMAIN],
|
||||||
Txt_MAIL_DOMAIN_ORDER[Mai_ORDER_BY_INFO ],
|
Txt_EMAIL_DOMAIN_ORDER[Mai_ORDER_BY_INFO ],
|
||||||
Txt_MAIL_DOMAIN_ORDER[Mai_ORDER_BY_USERS ]);
|
Txt_EMAIL_DOMAIN_ORDER[Mai_ORDER_BY_USERS ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -757,8 +757,8 @@ static void Mai_PutHeadMailDomains (void)
|
||||||
|
|
||||||
void Mai_RecFormNewMailDomain (void)
|
void Mai_RecFormNewMailDomain (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_mail_domain_X_already_exists;
|
extern const char *Txt_The_email_domain_X_already_exists;
|
||||||
extern const char *Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_mail_domain;
|
extern const char *Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_email_domain;
|
||||||
struct Mail *Mai;
|
struct Mail *Mai;
|
||||||
|
|
||||||
Mai = &Gbl.Mails.EditingMai;
|
Mai = &Gbl.Mails.EditingMai;
|
||||||
|
@ -775,13 +775,13 @@ void Mai_RecFormNewMailDomain (void)
|
||||||
/***** If name of mail was in database... *****/
|
/***** If name of mail was in database... *****/
|
||||||
if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L))
|
if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L))
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_The_mail_domain_X_already_exists,
|
sprintf (Gbl.Message,Txt_The_email_domain_X_already_exists,
|
||||||
Mai->Domain);
|
Mai->Domain);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L))
|
else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L))
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_The_mail_domain_X_already_exists,
|
sprintf (Gbl.Message,Txt_The_email_domain_X_already_exists,
|
||||||
Mai->Info);
|
Mai->Info);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
@ -789,7 +789,7 @@ void Mai_RecFormNewMailDomain (void)
|
||||||
Mai_CreateMailDomain (Mai);
|
Mai_CreateMailDomain (Mai);
|
||||||
}
|
}
|
||||||
else // If there is not a mail name
|
else // If there is not a mail name
|
||||||
Lay_ShowAlert (Lay_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_mail_domain);
|
Lay_ShowAlert (Lay_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_email_domain);
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Mai_EditMailDomains ();
|
Mai_EditMailDomains ();
|
||||||
|
@ -801,7 +801,7 @@ void Mai_RecFormNewMailDomain (void)
|
||||||
|
|
||||||
static void Mai_CreateMailDomain (struct Mail *Mai)
|
static void Mai_CreateMailDomain (struct Mail *Mai)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Created_new_mail_domain_X;
|
extern const char *Txt_Created_new_email_domain_X;
|
||||||
char Query[1024];
|
char Query[1024];
|
||||||
|
|
||||||
/***** Create a new mail *****/
|
/***** Create a new mail *****/
|
||||||
|
@ -810,24 +810,24 @@ static void Mai_CreateMailDomain (struct Mail *Mai)
|
||||||
DB_QueryINSERT (Query,"can not create mail domain");
|
DB_QueryINSERT (Query,"can not create mail domain");
|
||||||
|
|
||||||
/***** Write success message *****/
|
/***** Write success message *****/
|
||||||
sprintf (Gbl.Message,Txt_Created_new_mail_domain_X,
|
sprintf (Gbl.Message,Txt_Created_new_email_domain_X,
|
||||||
Mai->Domain);
|
Mai->Domain);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***** List the e-mails of all the students to creates an e-mail message *****/
|
/****** List the emails of all the students to creates an email message ******/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Mai_MAX_LENGTH_STR_ADDR (32*5000)
|
#define Mai_MAX_LENGTH_STR_ADDR (32*5000)
|
||||||
|
|
||||||
void Mai_ListEMails (void)
|
void Mai_ListEmails (void)
|
||||||
{
|
{
|
||||||
extern const char *The_ClassFormBold[The_NUM_THEMES];
|
extern const char *The_ClassFormBold[The_NUM_THEMES];
|
||||||
extern const char *Txt_Students_who_have_accepted_and_who_have_e_mail;
|
extern const char *Txt_Students_who_have_accepted_and_who_have_email;
|
||||||
extern const char *Txt_X_students_who_have_e_mail;
|
extern const char *Txt_X_students_who_have_email;
|
||||||
extern const char *Txt_X_students_who_have_accepted_and_who_have_e_mail;
|
extern const char *Txt_X_students_who_have_accepted_and_who_have_email;
|
||||||
extern const char *Txt_Create_e_mail_message;
|
extern const char *Txt_Create_email_message;
|
||||||
unsigned NumUsr;
|
unsigned NumUsr;
|
||||||
unsigned NumStdsWithEmail = 0;
|
unsigned NumStdsWithEmail = 0;
|
||||||
unsigned NumAcceptedStdsWithEmail = 0;
|
unsigned NumAcceptedStdsWithEmail = 0;
|
||||||
|
@ -845,9 +845,9 @@ void Mai_ListEMails (void)
|
||||||
{
|
{
|
||||||
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs,NULL))
|
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs,NULL))
|
||||||
{
|
{
|
||||||
/***** Start of the frame used to list the e-mails *****/
|
/***** Start of the frame used to list the emails *****/
|
||||||
Lay_StartRoundFrameTable (NULL,
|
Lay_StartRoundFrameTable (NULL,
|
||||||
Txt_Students_who_have_accepted_and_who_have_e_mail,
|
Txt_Students_who_have_accepted_and_who_have_email,
|
||||||
NULL,NULL,0);
|
NULL,NULL,0);
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_SMALL LEFT_MIDDLE\">");
|
"<td class=\"DAT_SMALL LEFT_MIDDLE\">");
|
||||||
|
@ -855,7 +855,7 @@ void Mai_ListEMails (void)
|
||||||
/***** Initialize structure with user's data *****/
|
/***** Initialize structure with user's data *****/
|
||||||
Usr_UsrDataConstructor (&UsrDat);
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
|
|
||||||
/***** List the students' e-mail addresses *****/
|
/***** List the students' email addresses *****/
|
||||||
for (NumUsr = 0;
|
for (NumUsr = 0;
|
||||||
NumUsr < Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs;
|
NumUsr < Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs;
|
||||||
NumUsr++)
|
NumUsr++)
|
||||||
|
@ -863,13 +863,13 @@ void Mai_ListEMails (void)
|
||||||
/* Copy user's basic data from list */
|
/* Copy user's basic data from list */
|
||||||
Usr_CopyBasicUsrDataFromList (&UsrDat,&Gbl.Usrs.LstUsrs[Rol_STUDENT].Lst[NumUsr]);
|
Usr_CopyBasicUsrDataFromList (&UsrDat,&Gbl.Usrs.LstUsrs[Rol_STUDENT].Lst[NumUsr]);
|
||||||
|
|
||||||
/* Get user's e-mail */
|
/* Get user's email */
|
||||||
Mai_GetEmailFromUsrCod (&UsrDat);
|
Mai_GetEmailFromUsrCod (&UsrDat);
|
||||||
|
|
||||||
if (UsrDat.Email[0])
|
if (UsrDat.Email[0])
|
||||||
{
|
{
|
||||||
NumStdsWithEmail++;
|
NumStdsWithEmail++;
|
||||||
if (UsrDat.Accepted) // If student has e-mail and has accepted
|
if (UsrDat.Accepted) // If student has email and has accepted
|
||||||
{
|
{
|
||||||
if (NumAcceptedStdsWithEmail > 0)
|
if (NumAcceptedStdsWithEmail > 0)
|
||||||
{
|
{
|
||||||
|
@ -878,13 +878,13 @@ void Mai_ListEMails (void)
|
||||||
if (LengthStrAddr <= Mai_MAX_LENGTH_STR_ADDR)
|
if (LengthStrAddr <= Mai_MAX_LENGTH_STR_ADDR)
|
||||||
strcat (StrAddresses,",");
|
strcat (StrAddresses,",");
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The space allocated to store e-mail addresses is full.");
|
Lay_ShowErrorAndExit ("The space allocated to store email addresses is full.");
|
||||||
}
|
}
|
||||||
LengthStrAddr += strlen (UsrDat.Email);
|
LengthStrAddr += strlen (UsrDat.Email);
|
||||||
if (LengthStrAddr <= Mai_MAX_LENGTH_STR_ADDR)
|
if (LengthStrAddr <= Mai_MAX_LENGTH_STR_ADDR)
|
||||||
strcat (StrAddresses,UsrDat.Email);
|
strcat (StrAddresses,UsrDat.Email);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The space allocated to store e-mail addresses is full.");
|
Lay_ShowErrorAndExit ("The space allocated to store email addresses is full.");
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<a href=\"mailto:%s?subject=%s\">%s</a>",
|
fprintf (Gbl.F.Out,"<a href=\"mailto:%s?subject=%s\">%s</a>",
|
||||||
UsrDat.Email,Gbl.CurrentCrs.Crs.FullName,UsrDat.Email);
|
UsrDat.Email,Gbl.CurrentCrs.Crs.FullName,UsrDat.Email);
|
||||||
|
@ -899,10 +899,10 @@ void Mai_ListEMails (void)
|
||||||
/***** Free memory used for user's data *****/
|
/***** Free memory used for user's data *****/
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** Show a message with the number of students with e-mail ****/
|
/***** Show a message with the number of students with email ****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT CENTER_MIDDLE\">");
|
"<td class=\"DAT CENTER_MIDDLE\">");
|
||||||
fprintf (Gbl.F.Out,Txt_X_students_who_have_e_mail,
|
fprintf (Gbl.F.Out,Txt_X_students_who_have_email,
|
||||||
NumStdsWithEmail,
|
NumStdsWithEmail,
|
||||||
((float) NumStdsWithEmail /
|
((float) NumStdsWithEmail /
|
||||||
(float) Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs) * 100.0,
|
(float) Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs) * 100.0,
|
||||||
|
@ -910,10 +910,10 @@ void Mai_ListEMails (void)
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/***** Show a message with the number of students who have accepted and have e-mail ****/
|
/***** Show a message with the number of students who have accepted and have email ****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT CENTER_MIDDLE\">");
|
"<td class=\"DAT CENTER_MIDDLE\">");
|
||||||
fprintf (Gbl.F.Out,Txt_X_students_who_have_accepted_and_who_have_e_mail,
|
fprintf (Gbl.F.Out,Txt_X_students_who_have_accepted_and_who_have_email,
|
||||||
NumAcceptedStdsWithEmail,
|
NumAcceptedStdsWithEmail,
|
||||||
((float) NumAcceptedStdsWithEmail /
|
((float) NumAcceptedStdsWithEmail /
|
||||||
(float) Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs) * 100.0,
|
(float) Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs) * 100.0,
|
||||||
|
@ -921,10 +921,10 @@ void Mai_ListEMails (void)
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/***** End of the frame used to list the e-mails *****/
|
/***** End of the frame used to list the emails *****/
|
||||||
Lay_EndRoundFrameTable ();
|
Lay_EndRoundFrameTable ();
|
||||||
|
|
||||||
/***** Icon to open the client e-mail program *****/
|
/***** Icon to open the client email program *****/
|
||||||
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">"
|
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">"
|
||||||
"<a href=\"mailto:%s?subject=%s&cc=%s&bcc=%s\""
|
"<a href=\"mailto:%s?subject=%s&cc=%s&bcc=%s\""
|
||||||
" title=\"%s\" class=\"%s\">",
|
" title=\"%s\" class=\"%s\">",
|
||||||
|
@ -932,11 +932,11 @@ void Mai_ListEMails (void)
|
||||||
Gbl.CurrentCrs.Crs.FullName,
|
Gbl.CurrentCrs.Crs.FullName,
|
||||||
Gbl.Usrs.Me.UsrDat.Email,
|
Gbl.Usrs.Me.UsrDat.Email,
|
||||||
StrAddresses,
|
StrAddresses,
|
||||||
Txt_Create_e_mail_message,
|
Txt_Create_email_message,
|
||||||
The_ClassFormBold[Gbl.Prefs.Theme]);
|
The_ClassFormBold[Gbl.Prefs.Theme]);
|
||||||
Lay_PutIconWithText ("editnewmsg16x16.gif",
|
Lay_PutIconWithText ("editnewmsg16x16.gif",
|
||||||
Txt_Create_e_mail_message,
|
Txt_Create_email_message,
|
||||||
Txt_Create_e_mail_message);
|
Txt_Create_email_message);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</div>");
|
"</div>");
|
||||||
}
|
}
|
||||||
|
@ -952,7 +952,7 @@ void Mai_ListEMails (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************** Check whether an e-mail address if valid *******************/
|
/**************** Check whether an email address if valid ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
bool Mai_CheckIfEmailIsValid (const char *Email)
|
bool Mai_CheckIfEmailIsValid (const char *Email)
|
||||||
|
@ -963,13 +963,13 @@ bool Mai_CheckIfEmailIsValid (const char *Email)
|
||||||
unsigned Pos;
|
unsigned Pos;
|
||||||
bool ArrobaFound = false;
|
bool ArrobaFound = false;
|
||||||
|
|
||||||
/***** An e-mail address must have a number of characters
|
/***** An email address must have a number of characters
|
||||||
5 <= Length <= Mai_MAX_BYTES_USR_EMAIL *****/
|
5 <= Length <= Mai_MAX_BYTES_USR_EMAIL *****/
|
||||||
if (Length < 5 ||
|
if (Length < 5 ||
|
||||||
Length > Usr_MAX_BYTES_USR_EMAIL)
|
Length > Usr_MAX_BYTES_USR_EMAIL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/***** An e-mail address can have digits, letters, '.', '-' and '_';
|
/***** An email address can have digits, letters, '.', '-' and '_';
|
||||||
and must have one and only '@' (not in any position) *****/
|
and must have one and only '@' (not in any position) *****/
|
||||||
for (Ptr = Email, Pos = 0;
|
for (Ptr = Email, Pos = 0;
|
||||||
*Ptr;
|
*Ptr;
|
||||||
|
@ -1000,7 +1000,7 @@ bool Mai_CheckIfEmailIsValid (const char *Email)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********** Get e-mail address of a user from his/her user's code ************/
|
/********** Get email address of a user from his/her user's code *************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat)
|
bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat)
|
||||||
|
@ -1015,7 +1015,7 @@ bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat)
|
||||||
sprintf (Query,"SELECT E_mail,Confirmed FROM usr_emails"
|
sprintf (Query,"SELECT E_mail,Confirmed FROM usr_emails"
|
||||||
" WHERE UsrCod='%ld' ORDER BY CreatTime DESC LIMIT 1",
|
" WHERE UsrCod='%ld' ORDER BY CreatTime DESC LIMIT 1",
|
||||||
UsrDat->UsrCod);
|
UsrDat->UsrCod);
|
||||||
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get e-mail address");
|
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get email address");
|
||||||
|
|
||||||
if (NumRows == 0)
|
if (NumRows == 0)
|
||||||
{
|
{
|
||||||
|
@ -1027,7 +1027,7 @@ bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat)
|
||||||
{
|
{
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get e-mail */
|
/* Get email */
|
||||||
strcpy (UsrDat->Email,row[0]);
|
strcpy (UsrDat->Email,row[0]);
|
||||||
|
|
||||||
UsrDat->EmailConfirmed = (row[1][0] == 'Y');
|
UsrDat->EmailConfirmed = (row[1][0] == 'Y');
|
||||||
|
@ -1042,9 +1042,9 @@ bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************* Get user's code of a user from his/her e-mail *****************/
|
/************* Get user's code of a user from his/her email ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Returns -1L if e-mail not found
|
// Returns -1L if email not found
|
||||||
|
|
||||||
long Mai_GetUsrCodFromEmail (const char *Email)
|
long Mai_GetUsrCodFromEmail (const char *Email)
|
||||||
{
|
{
|
||||||
|
@ -1065,7 +1065,7 @@ long Mai_GetUsrCodFromEmail (const char *Email)
|
||||||
Email);
|
Email);
|
||||||
NumUsrs = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get user's code");
|
NumUsrs = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get user's code");
|
||||||
if (NumUsrs == 0)
|
if (NumUsrs == 0)
|
||||||
/* User not found for this e-mail ==> set user's code to void */
|
/* User not found for this email ==> set user's code to void */
|
||||||
UsrCod = -1L;
|
UsrCod = -1L;
|
||||||
else if (NumUsrs == 1) // One user found
|
else if (NumUsrs == 1) // One user found
|
||||||
{
|
{
|
||||||
|
@ -1075,8 +1075,8 @@ long Mai_GetUsrCodFromEmail (const char *Email)
|
||||||
/* Get user's code */
|
/* Get user's code */
|
||||||
UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
}
|
}
|
||||||
else // NumRows > 1 ==> impossible, an e-mail can not be reapeated
|
else // NumRows > 1 ==> impossible, an email can not be reapeated
|
||||||
Lay_ShowErrorAndExit ("Internal error: e-mail is repeated in database.");
|
Lay_ShowErrorAndExit ("Internal error: email is repeated in database.");
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
@ -1086,7 +1086,7 @@ long Mai_GetUsrCodFromEmail (const char *Email)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********** Put a link to the action used to change user's e-mail ************/
|
/********** Put a link to the action used to change user's email *************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_PutLinkToChangeOtherUsrEmail (void)
|
void Mai_PutLinkToChangeOtherUsrEmail (void)
|
||||||
|
@ -1110,7 +1110,7 @@ void Mai_PutLinkToChangeOtherUsrEmail (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********** Show form to the change the e-mail of another user **************/
|
/*********** Show form to the change the email of another user ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_ShowFormOthEmail (void)
|
void Mai_ShowFormOthEmail (void)
|
||||||
|
@ -1129,7 +1129,7 @@ void Mai_ShowFormOthEmail (void)
|
||||||
/***** Show user's record *****/
|
/***** Show user's record *****/
|
||||||
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
||||||
|
|
||||||
/***** Form with the user's e-mail *****/
|
/***** Form with the user's email *****/
|
||||||
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">");
|
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">");
|
||||||
Mai_ShowFormChangeUsrEmail (&Gbl.Usrs.Other.UsrDat,
|
Mai_ShowFormChangeUsrEmail (&Gbl.Usrs.Other.UsrDat,
|
||||||
(Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me?
|
(Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me?
|
||||||
|
@ -1146,7 +1146,7 @@ void Mai_ShowFormOthEmail (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Show form to change my e-mail ***********************/
|
/*********************** Show form to change my email ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
|
@ -1168,19 +1168,19 @@ void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
unsigned NumEmail;
|
unsigned NumEmail;
|
||||||
bool Confirmed;
|
bool Confirmed;
|
||||||
|
|
||||||
/***** Get my e-mails *****/
|
/***** Get my emails *****/
|
||||||
sprintf (Query,"SELECT E_mail,Confirmed FROM usr_emails"
|
sprintf (Query,"SELECT E_mail,Confirmed FROM usr_emails"
|
||||||
" WHERE UsrCod='%ld'"
|
" WHERE UsrCod='%ld'"
|
||||||
" ORDER BY CreatTime DESC",
|
" ORDER BY CreatTime DESC",
|
||||||
UsrDat->UsrCod);
|
UsrDat->UsrCod);
|
||||||
NumEmails = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get old e-mail addresses of a user");
|
NumEmails = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get old email addresses of a user");
|
||||||
|
|
||||||
/***** List my e-mails *****/
|
/***** List my emails *****/
|
||||||
for (NumEmail = 1;
|
for (NumEmail = 1;
|
||||||
NumEmail <= NumEmails;
|
NumEmail <= NumEmails;
|
||||||
NumEmail++)
|
NumEmail++)
|
||||||
{
|
{
|
||||||
/* Get e-mail */
|
/* Get email */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
Confirmed = (row[1][0] == 'Y');
|
Confirmed = (row[1][0] == 'Y');
|
||||||
|
|
||||||
|
@ -1207,7 +1207,7 @@ void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
"<div class=\"FORM_ACCOUNT\">");
|
"<div class=\"FORM_ACCOUNT\">");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Form to remove e-mail */
|
/* Form to remove email */
|
||||||
if (ItsMe)
|
if (ItsMe)
|
||||||
Act_FormStart (ActRemMaiMe);
|
Act_FormStart (ActRemMaiMe);
|
||||||
else
|
else
|
||||||
|
@ -1222,13 +1222,13 @@ void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
Lay_PutIconRemove ();
|
Lay_PutIconRemove ();
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
|
|
||||||
/* E-mail */
|
/* Email */
|
||||||
fprintf (Gbl.F.Out,"<span class=\"%s\">%s</span>",
|
fprintf (Gbl.F.Out,"<span class=\"%s\">%s</span>",
|
||||||
NumEmail == 1 ? "USR_ID" :
|
NumEmail == 1 ? "USR_ID" :
|
||||||
"DAT",
|
"DAT",
|
||||||
row[0]);
|
row[0]);
|
||||||
|
|
||||||
/* E-mail confirmed? */
|
/* Email confirmed? */
|
||||||
if (Confirmed)
|
if (Confirmed)
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Title,Txt_Email_X_confirmed,row[0]);
|
sprintf (Gbl.Title,Txt_Email_X_confirmed,row[0]);
|
||||||
|
@ -1241,7 +1241,7 @@ void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
|
||||||
/* Form to change user's e-mail */
|
/* Form to change user's email */
|
||||||
if (NumEmail > 1 || (ItsMe && !Confirmed))
|
if (NumEmail > 1 || (ItsMe && !Confirmed))
|
||||||
{
|
{
|
||||||
if (ItsMe)
|
if (ItsMe)
|
||||||
|
@ -1254,7 +1254,7 @@ void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"<input type=\"hidden\" name=\"NewEmail\" value=\"%s\" />",
|
fprintf (Gbl.F.Out,"<input type=\"hidden\" name=\"NewEmail\" value=\"%s\" />",
|
||||||
row[0]); // E-mail
|
row[0]); // Email
|
||||||
Lay_PutConfirmButtonInline ((ItsMe && NumEmail == 1) ? Txt_Confirm_email :
|
Lay_PutConfirmButtonInline ((ItsMe && NumEmail == 1) ? Txt_Confirm_email :
|
||||||
Txt_Use_this_email);
|
Txt_Use_this_email);
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
|
@ -1265,15 +1265,15 @@ void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
"</tr>");
|
"</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Form to enter new e-mail *****/
|
/***** Form to enter new email *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"LEFT_MIDDLE\">",
|
"<td class=\"LEFT_MIDDLE\">",
|
||||||
The_ClassForm[Gbl.Prefs.Theme],
|
The_ClassForm[Gbl.Prefs.Theme],
|
||||||
NumEmails ? Txt_New_email : // A new e-mail
|
NumEmails ? Txt_New_email : // A new email
|
||||||
Txt_Email); // The first e-mail
|
Txt_Email); // The first email
|
||||||
if (ItsMe)
|
if (ItsMe)
|
||||||
Act_FormStart (ActNewMaiMe);
|
Act_FormStart (ActNewMaiMe);
|
||||||
else
|
else
|
||||||
|
@ -1289,20 +1289,20 @@ void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||||
"</div>",
|
"</div>",
|
||||||
Usr_MAX_BYTES_USR_EMAIL,
|
Usr_MAX_BYTES_USR_EMAIL,
|
||||||
Gbl.Usrs.Me.UsrDat.Email);
|
Gbl.Usrs.Me.UsrDat.Email);
|
||||||
Lay_PutCreateButtonInline (NumEmails ? Txt_Change_email : // User already has an e-mail address
|
Lay_PutCreateButtonInline (NumEmails ? Txt_Change_email : // User already has an email address
|
||||||
Txt_Save); // User has no e-mail address yet
|
Txt_Save); // User has no email address yet
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************* Remove one of my user's e-mails *************************/
|
/******************** Remove one of my user's emails *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_RemoveMyUsrEmail (void)
|
void Mai_RemoveMyUsrEmail (void)
|
||||||
{
|
{
|
||||||
/***** Remove user's e-mail *****/
|
/***** Remove user's email *****/
|
||||||
Mai_RemoveEmail (&Gbl.Usrs.Me.UsrDat);
|
Mai_RemoveEmail (&Gbl.Usrs.Me.UsrDat);
|
||||||
|
|
||||||
/***** Show my account again *****/
|
/***** Show my account again *****/
|
||||||
|
@ -1320,7 +1320,7 @@ void Mai_RemoveOtherUsrEmail (void)
|
||||||
/***** Get other user's code from form and get user's data *****/
|
/***** Get other user's code from form and get user's data *****/
|
||||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||||
{
|
{
|
||||||
/***** Remove user's e-mail *****/
|
/***** Remove user's email *****/
|
||||||
Mai_RemoveEmail (&Gbl.Usrs.Other.UsrDat);
|
Mai_RemoveEmail (&Gbl.Usrs.Other.UsrDat);
|
||||||
|
|
||||||
/***** Show user's record *****/
|
/***** Show user's record *****/
|
||||||
|
@ -1331,7 +1331,7 @@ void Mai_RemoveOtherUsrEmail (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** Remove e-mail address ****************************/
|
/************************** Remove email address *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Mai_RemoveEmail (struct UsrData *UsrDat)
|
static void Mai_RemoveEmail (struct UsrData *UsrDat)
|
||||||
|
@ -1342,17 +1342,17 @@ static void Mai_RemoveEmail (struct UsrData *UsrDat)
|
||||||
|
|
||||||
if (Pwd_CheckIfICanChangeOtherUsrPassword (UsrDat->UsrCod))
|
if (Pwd_CheckIfICanChangeOtherUsrPassword (UsrDat->UsrCod))
|
||||||
{
|
{
|
||||||
/***** Get new e-mail from form *****/
|
/***** Get new email from form *****/
|
||||||
Par_GetParToText ("Email",Email,Usr_MAX_BYTES_USR_EMAIL);
|
Par_GetParToText ("Email",Email,Usr_MAX_BYTES_USR_EMAIL);
|
||||||
|
|
||||||
/***** Remove one of user's old e-mail addresses *****/
|
/***** Remove one of user's old email addresses *****/
|
||||||
Mai_RemoveEmailFromDB (UsrDat->UsrCod,Email);
|
Mai_RemoveEmailFromDB (UsrDat->UsrCod,Email);
|
||||||
|
|
||||||
/***** Show message *****/
|
/***** Show message *****/
|
||||||
sprintf (Gbl.Message,Txt_Email_X_removed,Email);
|
sprintf (Gbl.Message,Txt_Email_X_removed,Email);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||||
|
|
||||||
/***** Update list of e-mails *****/
|
/***** Update list of emails *****/
|
||||||
Mai_GetEmailFromUsrCod (UsrDat);
|
Mai_GetEmailFromUsrCod (UsrDat);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1360,27 +1360,27 @@ static void Mai_RemoveEmail (struct UsrData *UsrDat)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*************** Remove an old e-mail address from database ******************/
|
/*************** Remove an old email address from database *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Mai_RemoveEmailFromDB (long UsrCod,const char *Email)
|
static void Mai_RemoveEmailFromDB (long UsrCod,const char *Email)
|
||||||
{
|
{
|
||||||
char Query[1024];
|
char Query[1024];
|
||||||
|
|
||||||
/***** Remove an old e-mail address *****/
|
/***** Remove an old email address *****/
|
||||||
sprintf (Query,"DELETE FROM usr_emails"
|
sprintf (Query,"DELETE FROM usr_emails"
|
||||||
" WHERE UsrCod='%ld' AND E_mail='%s'",
|
" WHERE UsrCod='%ld' AND E_mail='%s'",
|
||||||
UsrCod,Email);
|
UsrCod,Email);
|
||||||
DB_QueryREPLACE (Query,"can not remove an old e-mail address");
|
DB_QueryREPLACE (Query,"can not remove an old email address");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* New user's e-mail for me **************************/
|
/************************* New user's email for me ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void May_NewMyUsrEmail (void)
|
void May_NewMyUsrEmail (void)
|
||||||
{
|
{
|
||||||
/***** Remove user's e-mail *****/
|
/***** Remove user's email *****/
|
||||||
Mai_NewUsrEmail (&Gbl.Usrs.Me.UsrDat,true); // It's me
|
Mai_NewUsrEmail (&Gbl.Usrs.Me.UsrDat,true); // It's me
|
||||||
|
|
||||||
/***** Show my account again *****/
|
/***** Show my account again *****/
|
||||||
|
@ -1388,7 +1388,7 @@ void May_NewMyUsrEmail (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** New user's e-mail for another user *********************/
|
/********************* New user's email for another user *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_NewOtherUsrEmail (void)
|
void Mai_NewOtherUsrEmail (void)
|
||||||
|
@ -1410,7 +1410,7 @@ void Mai_NewOtherUsrEmail (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Update my e-mail address **************************/
|
/************************* Update my email address ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
|
static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
|
||||||
|
@ -1424,12 +1424,12 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
|
||||||
|
|
||||||
if (Pwd_CheckIfICanChangeOtherUsrPassword (UsrDat->UsrCod))
|
if (Pwd_CheckIfICanChangeOtherUsrPassword (UsrDat->UsrCod))
|
||||||
{
|
{
|
||||||
/***** Get new e-mail from form *****/
|
/***** Get new email from form *****/
|
||||||
Par_GetParToText ("NewEmail",NewEmail,Usr_MAX_BYTES_USR_EMAIL);
|
Par_GetParToText ("NewEmail",NewEmail,Usr_MAX_BYTES_USR_EMAIL);
|
||||||
|
|
||||||
if (Mai_CheckIfEmailIsValid (NewEmail)) // New e-mail is valid
|
if (Mai_CheckIfEmailIsValid (NewEmail)) // New email is valid
|
||||||
{
|
{
|
||||||
/***** Check if new e-mail exists in database *****/
|
/***** Check if new email exists in database *****/
|
||||||
if (UsrDat->EmailConfirmed &&
|
if (UsrDat->EmailConfirmed &&
|
||||||
!strcmp (UsrDat->Email,NewEmail)) // User's current confirmed email match exactly the new email
|
!strcmp (UsrDat->Email,NewEmail)) // User's current confirmed email match exactly the new email
|
||||||
{
|
{
|
||||||
|
@ -1441,12 +1441,12 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
|
||||||
{
|
{
|
||||||
if (Mai_UpdateEmailInDB (UsrDat,NewEmail))
|
if (Mai_UpdateEmailInDB (UsrDat,NewEmail))
|
||||||
{
|
{
|
||||||
/***** E-mail updated sucessfully *****/
|
/***** Email updated sucessfully *****/
|
||||||
sprintf (Gbl.Message,Txt_The_email_address_X_has_been_registered_successfully,
|
sprintf (Gbl.Message,Txt_The_email_address_X_has_been_registered_successfully,
|
||||||
NewEmail);
|
NewEmail);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||||
|
|
||||||
/***** Update list of e-mails *****/
|
/***** Update list of emails *****/
|
||||||
Mai_GetEmailFromUsrCod (UsrDat);
|
Mai_GetEmailFromUsrCod (UsrDat);
|
||||||
|
|
||||||
/***** Send message via email
|
/***** Send message via email
|
||||||
|
@ -1462,7 +1462,7 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // New e-mail is not valid
|
else // New email is not valid
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
|
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
|
||||||
NewEmail);
|
NewEmail);
|
||||||
|
@ -1474,46 +1474,46 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************ Update e-mail in database **************************/
|
/************************ Update email in database ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Return true if e-mail is successfully updated
|
// Return true if email is successfully updated
|
||||||
// Return false if e-mail can not be updated beacuse it is registered by another user
|
// Return false if email can not be updated beacuse it is registered by another user
|
||||||
|
|
||||||
bool Mai_UpdateEmailInDB (const struct UsrData *UsrDat,const char *NewEmail)
|
bool Mai_UpdateEmailInDB (const struct UsrData *UsrDat,const char *NewEmail)
|
||||||
{
|
{
|
||||||
char Query[1024];
|
char Query[1024];
|
||||||
|
|
||||||
/***** Check if the new e-mail matches any of the confirmed e-mails of other users *****/
|
/***** Check if the new email matches any of the confirmed emails of other users *****/
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
|
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
|
||||||
" WHERE E_mail='%s' AND Confirmed='Y'"
|
" WHERE E_mail='%s' AND Confirmed='Y'"
|
||||||
" AND UsrCod<>'%ld'",
|
" AND UsrCod<>'%ld'",
|
||||||
NewEmail,UsrDat->UsrCod);
|
NewEmail,UsrDat->UsrCod);
|
||||||
if (DB_QueryCOUNT (Query,"can not check if e-mail already existed")) // An e-mail of another user is the same that my e-mail
|
if (DB_QueryCOUNT (Query,"can not check if email already existed")) // An email of another user is the same that my email
|
||||||
return false; // Don't update
|
return false; // Don't update
|
||||||
|
|
||||||
/***** Delete e-mail (not confirmed) for other users *****/
|
/***** Delete email (not confirmed) for other users *****/
|
||||||
sprintf (Query,"DELETE FROM pending_emails"
|
sprintf (Query,"DELETE FROM pending_emails"
|
||||||
" WHERE E_mail='%s' AND UsrCod<>'%ld'",
|
" WHERE E_mail='%s' AND UsrCod<>'%ld'",
|
||||||
NewEmail,UsrDat->UsrCod);
|
NewEmail,UsrDat->UsrCod);
|
||||||
DB_QueryDELETE (Query,"can not remove pending e-mail for other users");
|
DB_QueryDELETE (Query,"can not remove pending email for other users");
|
||||||
|
|
||||||
sprintf (Query,"DELETE FROM usr_emails"
|
sprintf (Query,"DELETE FROM usr_emails"
|
||||||
" WHERE E_mail='%s' AND Confirmed='N'"
|
" WHERE E_mail='%s' AND Confirmed='N'"
|
||||||
" AND UsrCod<>'%ld'",
|
" AND UsrCod<>'%ld'",
|
||||||
NewEmail,UsrDat->UsrCod);
|
NewEmail,UsrDat->UsrCod);
|
||||||
DB_QueryDELETE (Query,"can not remove not confirmed e-mail for other users");
|
DB_QueryDELETE (Query,"can not remove not confirmed email for other users");
|
||||||
|
|
||||||
/***** Update e-mail in database *****/
|
/***** Update email in database *****/
|
||||||
sprintf (Query,"REPLACE INTO usr_emails"
|
sprintf (Query,"REPLACE INTO usr_emails"
|
||||||
" (UsrCod,E_mail,CreatTime) VALUES ('%ld','%s',NOW())",
|
" (UsrCod,E_mail,CreatTime) VALUES ('%ld','%s',NOW())",
|
||||||
UsrDat->UsrCod,NewEmail);
|
UsrDat->UsrCod,NewEmail);
|
||||||
DB_QueryREPLACE (Query,"can not update e-mail");
|
DB_QueryREPLACE (Query,"can not update email");
|
||||||
|
|
||||||
return true; // Successfully updated
|
return true; // Successfully updated
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********** Put button to go to check and confirm my e-mail address **********/
|
/********** Put button to go to check and confirm my email address ***********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_PutButtonToCheckEmailAddress (void)
|
void Mai_PutButtonToCheckEmailAddress (void)
|
||||||
|
@ -1535,7 +1535,7 @@ void Mai_PutButtonToCheckEmailAddress (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************** Send mail message to confirm my e-mail address ***************/
|
/************** Send mail message to confirm my email address ****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Return true on success
|
// Return true on success
|
||||||
// Return false on error
|
// Return false on error
|
||||||
|
@ -1546,7 +1546,7 @@ bool Mai_SendMailMsgToConfirmEmail (void)
|
||||||
extern const char *Txt_If_you_just_request_from_X_the_confirmation_of_your_email_Y_NO_HTML;
|
extern const char *Txt_If_you_just_request_from_X_the_confirmation_of_your_email_Y_NO_HTML;
|
||||||
extern const char *Txt_Confirmation_of_your_email_NO_HTML;
|
extern const char *Txt_Confirmation_of_your_email_NO_HTML;
|
||||||
extern const char *Txt_There_was_a_problem_sending_an_email_automatically;
|
extern const char *Txt_There_was_a_problem_sending_an_email_automatically;
|
||||||
char Command[2048]; // Command to execute for sending an e-mail
|
char Command[2048]; // Command to execute for sending an email
|
||||||
int ReturnCode;
|
int ReturnCode;
|
||||||
|
|
||||||
/***** Create temporary file for mail content *****/
|
/***** Create temporary file for mail content *****/
|
||||||
|
@ -1571,9 +1571,9 @@ bool Mai_SendMailMsgToConfirmEmail (void)
|
||||||
|
|
||||||
fclose (Gbl.Msg.FileMail);
|
fclose (Gbl.Msg.FileMail);
|
||||||
|
|
||||||
/***** Call the script to send an e-mail *****/
|
/***** Call the script to send an email *****/
|
||||||
sprintf (Command,"%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"[%s] %s\" \"%s\"",
|
sprintf (Command,"%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"[%s] %s\" \"%s\"",
|
||||||
Cfg_COMMAND_SEND_AUTOMATIC_E_MAIL,
|
Cfg_COMMAND_SEND_AUTOMATIC_EMAIL,
|
||||||
Cfg_AUTOMATIC_EMAIL_SMTP_SERVER,
|
Cfg_AUTOMATIC_EMAIL_SMTP_SERVER,
|
||||||
Cfg_AUTOMATIC_EMAIL_SMTP_PORT,
|
Cfg_AUTOMATIC_EMAIL_SMTP_PORT,
|
||||||
Cfg_AUTOMATIC_EMAIL_FROM,
|
Cfg_AUTOMATIC_EMAIL_FROM,
|
||||||
|
@ -1583,7 +1583,7 @@ bool Mai_SendMailMsgToConfirmEmail (void)
|
||||||
Gbl.Msg.FileNameMail);
|
Gbl.Msg.FileNameMail);
|
||||||
ReturnCode = system (Command);
|
ReturnCode = system (Command);
|
||||||
if (ReturnCode == -1)
|
if (ReturnCode == -1)
|
||||||
Lay_ShowErrorAndExit ("Error when running script to send e-mail.");
|
Lay_ShowErrorAndExit ("Error when running script to send email.");
|
||||||
|
|
||||||
/***** Remove temporary file *****/
|
/***** Remove temporary file *****/
|
||||||
unlink (Gbl.Msg.FileNameMail);
|
unlink (Gbl.Msg.FileNameMail);
|
||||||
|
@ -1608,7 +1608,7 @@ bool Mai_SendMailMsgToConfirmEmail (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******* Show alert to report that confirmation e-mail has been sent *********/
|
/******* Show alert to report that confirmation email has been sent **********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_ShowMsgConfirmEmailHasBeenSent (void)
|
void Mai_ShowMsgConfirmEmailHasBeenSent (void)
|
||||||
|
@ -1628,7 +1628,7 @@ static void Mai_InsertMailKey (const char *Email,const char MailKey[Mai_LENGTH_E
|
||||||
{
|
{
|
||||||
char Query[512+Mai_LENGTH_EMAIL_CONFIRM_KEY];
|
char Query[512+Mai_LENGTH_EMAIL_CONFIRM_KEY];
|
||||||
|
|
||||||
/***** Remove expired pending e-mails from database *****/
|
/***** Remove expired pending emails from database *****/
|
||||||
sprintf (Query,"DELETE FROM pending_emails"
|
sprintf (Query,"DELETE FROM pending_emails"
|
||||||
" WHERE DateAndTime<FROM_UNIXTIME(UNIX_TIMESTAMP()-'%lu')",
|
" WHERE DateAndTime<FROM_UNIXTIME(UNIX_TIMESTAMP()-'%lu')",
|
||||||
Cfg_TIME_TO_DELETE_OLD_PENDING_EMAILS);
|
Cfg_TIME_TO_DELETE_OLD_PENDING_EMAILS);
|
||||||
|
@ -1644,7 +1644,7 @@ static void Mai_InsertMailKey (const char *Email,const char MailKey[Mai_LENGTH_E
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Confirm my e-mail address *************************/
|
/************************* Confirm my email address **************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_ConfirmEmail (void)
|
void Mai_ConfirmEmail (void)
|
||||||
|
@ -1665,17 +1665,17 @@ void Mai_ConfirmEmail (void)
|
||||||
/***** Get parameter Key *****/
|
/***** Get parameter Key *****/
|
||||||
Par_GetParToText ("key",MailKey,Mai_LENGTH_EMAIL_CONFIRM_KEY);
|
Par_GetParToText ("key",MailKey,Mai_LENGTH_EMAIL_CONFIRM_KEY);
|
||||||
|
|
||||||
/***** Get user's code and e-mail from key *****/
|
/***** Get user's code and email from key *****/
|
||||||
sprintf (Query,"SELECT UsrCod,E_mail FROM pending_emails"
|
sprintf (Query,"SELECT UsrCod,E_mail FROM pending_emails"
|
||||||
" WHERE MailKey='%s'",MailKey);
|
" WHERE MailKey='%s'",MailKey);
|
||||||
if (DB_QuerySELECT (Query,&mysql_res,"can not get user's code and e-mail from key"))
|
if (DB_QuerySELECT (Query,&mysql_res,"can not get user's code and email from key"))
|
||||||
{
|
{
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get user's code */
|
/* Get user's code */
|
||||||
UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
|
||||||
/* Get user's e-mail */
|
/* Get user's email */
|
||||||
strcpy (Email,row[1]);
|
strcpy (Email,row[1]);
|
||||||
|
|
||||||
KeyIsCorrect = true;
|
KeyIsCorrect = true;
|
||||||
|
@ -1689,18 +1689,18 @@ void Mai_ConfirmEmail (void)
|
||||||
/***** Delete this key *****/
|
/***** Delete this key *****/
|
||||||
sprintf (Query,"DELETE FROM pending_emails"
|
sprintf (Query,"DELETE FROM pending_emails"
|
||||||
" WHERE MailKey='%s'",MailKey);
|
" WHERE MailKey='%s'",MailKey);
|
||||||
DB_QueryDELETE (Query,"can not remove an e-mail key");
|
DB_QueryDELETE (Query,"can not remove an email key");
|
||||||
|
|
||||||
/***** Check user's code and e-mail
|
/***** Check user's code and email
|
||||||
and get if e-mail is already confirmed *****/
|
and get if email is already confirmed *****/
|
||||||
sprintf (Query,"SELECT Confirmed FROM usr_emails"
|
sprintf (Query,"SELECT Confirmed FROM usr_emails"
|
||||||
" WHERE UsrCod='%ld' AND E_mail='%s'",
|
" WHERE UsrCod='%ld' AND E_mail='%s'",
|
||||||
UsrCod,Email);
|
UsrCod,Email);
|
||||||
if (DB_QuerySELECT (Query,&mysql_res,"can not get user's code and e-mail"))
|
if (DB_QuerySELECT (Query,&mysql_res,"can not get user's code and email"))
|
||||||
{
|
{
|
||||||
Confirmed = (row[0][0] == 'Y');
|
Confirmed = (row[0][0] == 'Y');
|
||||||
|
|
||||||
/***** Confirm e-mail *****/
|
/***** Confirm email *****/
|
||||||
if (Confirmed)
|
if (Confirmed)
|
||||||
sprintf (Gbl.Message,Txt_Email_X_has_already_been_confirmed_before,
|
sprintf (Gbl.Message,Txt_Email_X_has_already_been_confirmed_before,
|
||||||
Email);
|
Email);
|
||||||
|
@ -1710,7 +1710,7 @@ void Mai_ConfirmEmail (void)
|
||||||
" WHERE usr_emails.UsrCod='%ld'"
|
" WHERE usr_emails.UsrCod='%ld'"
|
||||||
" AND usr_emails.E_mail='%s'",
|
" AND usr_emails.E_mail='%s'",
|
||||||
UsrCod,Email);
|
UsrCod,Email);
|
||||||
DB_QueryUPDATE (Query,"can not confirm e-mail");
|
DB_QueryUPDATE (Query,"can not confirm email");
|
||||||
sprintf (Gbl.Message,Txt_The_email_X_has_been_confirmed,Email);
|
sprintf (Gbl.Message,Txt_The_email_X_has_been_confirmed,Email);
|
||||||
strcat (Gbl.Message,".");
|
strcat (Gbl.Message,".");
|
||||||
}
|
}
|
||||||
|
@ -1738,11 +1738,11 @@ void Mai_CreateFileNameMail (void)
|
||||||
sprintf (Gbl.Msg.FileNameMail,"%s/%s/%s_mail.txt",
|
sprintf (Gbl.Msg.FileNameMail,"%s/%s/%s_mail.txt",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
|
||||||
if ((Gbl.Msg.FileMail = fopen (Gbl.Msg.FileNameMail,"wb")) == NULL)
|
if ((Gbl.Msg.FileMail = fopen (Gbl.Msg.FileNameMail,"wb")) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Can not open file to send e-mail.");
|
Lay_ShowErrorAndExit ("Can not open file to send email.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************ Write a welcome note heading the automatic e-mail **************/
|
/************ Write a welcome note heading the automatic email ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat)
|
void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat)
|
||||||
|
@ -1757,7 +1757,7 @@ void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** Write a foot note in the automatic e-mail ****************/
|
/****************** Write a foot note in the automatic email *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mai_WriteFootNoteEMail (Txt_Language_t Language)
|
void Mai_WriteFootNoteEMail (Txt_Language_t Language)
|
||||||
|
@ -1773,7 +1773,7 @@ void Mai_WriteFootNoteEMail (Txt_Language_t Language)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************** Check if I can see another user's e-mail *******************/
|
/**************** Check if I can see another user's email ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
bool Mai_ICanSeeEmail (struct UsrData *UsrDat)
|
bool Mai_ICanSeeEmail (struct UsrData *UsrDat)
|
||||||
|
@ -1783,31 +1783,31 @@ bool Mai_ICanSeeEmail (struct UsrData *UsrDat)
|
||||||
if (ItsMe)
|
if (ItsMe)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Check if I have permission to see another user's e-mail */
|
/* Check if I have permission to see another user's email */
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_STUDENT:
|
case Rol_STUDENT:
|
||||||
/* If I am a student of current course,
|
/* If I am a student of current course,
|
||||||
I only can see the user's e-mail of teachers from current course */
|
I only can see the user's email of teachers from current course */
|
||||||
return (UsrDat->Accepted &&
|
return (UsrDat->Accepted &&
|
||||||
UsrDat->RoleInCurrentCrsDB == Rol_TEACHER);
|
UsrDat->RoleInCurrentCrsDB == Rol_TEACHER);
|
||||||
case Rol_TEACHER:
|
case Rol_TEACHER:
|
||||||
/* If I am a teacher of current course,
|
/* If I am a teacher of current course,
|
||||||
I only can see the user's e-mail of students or teachers from current course */
|
I only can see the user's email of students or teachers from current course */
|
||||||
return (UsrDat->Accepted &&
|
return (UsrDat->Accepted &&
|
||||||
(UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ||
|
(UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ||
|
||||||
UsrDat->RoleInCurrentCrsDB == Rol_TEACHER));
|
UsrDat->RoleInCurrentCrsDB == Rol_TEACHER));
|
||||||
case Rol_DEG_ADM:
|
case Rol_DEG_ADM:
|
||||||
/* If I am an administrator of current degree,
|
/* If I am an administrator of current degree,
|
||||||
I only can see the user's e-mail of users from current degree */
|
I only can see the user's email of users from current degree */
|
||||||
return Usr_CheckIfUsrBelongsToDeg (UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod,true);
|
return Usr_CheckIfUsrBelongsToDeg (UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod,true);
|
||||||
case Rol_CTR_ADM:
|
case Rol_CTR_ADM:
|
||||||
/* If I am an administrator of current centre,
|
/* If I am an administrator of current centre,
|
||||||
I only can see the user's e-mail of users from current centre */
|
I only can see the user's email of users from current centre */
|
||||||
return Usr_CheckIfUsrBelongsToCtr (UsrDat->UsrCod,Gbl.CurrentCtr.Ctr.CtrCod,true);
|
return Usr_CheckIfUsrBelongsToCtr (UsrDat->UsrCod,Gbl.CurrentCtr.Ctr.CtrCod,true);
|
||||||
case Rol_INS_ADM:
|
case Rol_INS_ADM:
|
||||||
/* If I am an administrator of current institution,
|
/* If I am an administrator of current institution,
|
||||||
I only can see the user's e-mail of users from current institution */
|
I only can see the user's email of users from current institution */
|
||||||
return Usr_CheckIfUsrBelongsToIns (UsrDat->UsrCod,Gbl.CurrentIns.Ins.InsCod,true);
|
return Usr_CheckIfUsrBelongsToIns (UsrDat->UsrCod,Gbl.CurrentIns.Ins.InsCod,true);
|
||||||
case Rol_SYS_ADM:
|
case Rol_SYS_ADM:
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// swad_mail.h: all the stuff related to e-mail
|
// swad_mail.h: all the stuff related to email
|
||||||
|
|
||||||
#ifndef _SWAD_MAI
|
#ifndef _SWAD_MAI
|
||||||
#define _SWAD_MAI
|
#define _SWAD_MAI
|
||||||
|
@ -69,7 +69,7 @@ void Mai_RenameMailDomainShort (void);
|
||||||
void Mai_RenameMailDomainFull (void);
|
void Mai_RenameMailDomainFull (void);
|
||||||
void Mai_RecFormNewMailDomain (void);
|
void Mai_RecFormNewMailDomain (void);
|
||||||
|
|
||||||
void Mai_ListEMails (void); // Creates an e-mail message to students
|
void Mai_ListEmails (void); // Creates an email message to students
|
||||||
|
|
||||||
bool Mai_CheckIfEmailIsValid (const char *Email);
|
bool Mai_CheckIfEmailIsValid (const char *Email);
|
||||||
bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat);
|
bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat);
|
||||||
|
|
|
@ -422,7 +422,7 @@ static void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (void)
|
||||||
if (PutColspan)
|
if (PutColspan)
|
||||||
Colspan = Usr_GetColumnsForSelectUsrs ();
|
Colspan = Usr_GetColumnsForSelectUsrs ();
|
||||||
|
|
||||||
/***** Textarea with users' @nicknames, e-mails or IDs *****/
|
/***** Textarea with users' @nicknames, emails or IDs *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<th class=\"LEFT_MIDDLE LIGHT_BLUE\"");
|
"<th class=\"LEFT_MIDDLE LIGHT_BLUE\"");
|
||||||
if (PutColspan)
|
if (PutColspan)
|
||||||
|
@ -606,8 +606,8 @@ void Msg_RecMsgFromUsr (void)
|
||||||
extern const char *Txt_You_can_not_send_a_message_to_so_many_recipients_;
|
extern const char *Txt_You_can_not_send_a_message_to_so_many_recipients_;
|
||||||
extern const char *Txt_You_must_select_one_ore_more_recipients;
|
extern const char *Txt_You_must_select_one_ore_more_recipients;
|
||||||
extern const char *Txt_message_not_sent_to_X;
|
extern const char *Txt_message_not_sent_to_X;
|
||||||
extern const char *Txt_message_sent_to_X_notified_by_e_mail;
|
extern const char *Txt_message_sent_to_X_notified_by_email;
|
||||||
extern const char *Txt_message_sent_to_X_not_notified_by_e_mail;
|
extern const char *Txt_message_sent_to_X_not_notified_by_email;
|
||||||
extern const char *Txt_Error_getting_data_from_a_recipient;
|
extern const char *Txt_Error_getting_data_from_a_recipient;
|
||||||
extern const char *Txt_Do_not_reload_this_page_because_the_message_will_be_sent_again_;
|
extern const char *Txt_Do_not_reload_this_page_because_the_message_will_be_sent_again_;
|
||||||
extern const char *Txt_The_message_has_not_been_sent_to_any_recipient;
|
extern const char *Txt_The_message_has_not_been_sent_to_any_recipient;
|
||||||
|
@ -688,7 +688,7 @@ void Msg_RecMsgFromUsr (void)
|
||||||
/***** Allocate space to store a list of recipients with the following format:
|
/***** Allocate space to store a list of recipients with the following format:
|
||||||
"FirstName Surname1 Surname2; FirstName Surname1 Surname2; FirstName Surname1 Surname2" *****/
|
"FirstName Surname1 Surname2; FirstName Surname1 Surname2; FirstName Surname1 Surname2" *****/
|
||||||
if ((ListUsrsDst = (char *) malloc (((Usr_MAX_BYTES_NAME+1)*3+1)*NumRecipients)) == NULL)
|
if ((ListUsrsDst = (char *) malloc (((Usr_MAX_BYTES_NAME+1)*3+1)*NumRecipients)) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Not enough memory to store e-mail addresses of recipients.");
|
Lay_ShowErrorAndExit ("Not enough memory to store email addresses of recipients.");
|
||||||
ListUsrsDst[0] = '\0';
|
ListUsrsDst[0] = '\0';
|
||||||
|
|
||||||
/***** Initialize structure with user's data *****/
|
/***** Initialize structure with user's data *****/
|
||||||
|
@ -739,7 +739,7 @@ void Msg_RecMsgFromUsr (void)
|
||||||
Replied = (IsReply &&
|
Replied = (IsReply &&
|
||||||
UsrDstData.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod);
|
UsrDstData.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||||
|
|
||||||
/***** This received message must be notified by e-mail? *****/
|
/***** This received message must be notified by email? *****/
|
||||||
CreateNotif = (UsrDstData.Prefs.NotifNtfEvents & (1 << Ntf_EVENT_MESSAGE));
|
CreateNotif = (UsrDstData.Prefs.NotifNtfEvents & (1 << Ntf_EVENT_MESSAGE));
|
||||||
NotifyByEmail = CreateNotif &&
|
NotifyByEmail = CreateNotif &&
|
||||||
(UsrDstData.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) &&
|
(UsrDstData.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) &&
|
||||||
|
@ -750,15 +750,16 @@ void Msg_RecMsgFromUsr (void)
|
||||||
Msg_InsertReceivedMsgIntoDB (NewMsgCod,UsrDstData.UsrCod,NotifyByEmail);
|
Msg_InsertReceivedMsgIntoDB (NewMsgCod,UsrDstData.UsrCod,NotifyByEmail);
|
||||||
|
|
||||||
/***** Create notification for this recipient.
|
/***** Create notification for this recipient.
|
||||||
If this recipient wants to receive notifications by e-mail, activate the sending of a notification *****/
|
If this recipient wants to receive notifications by -mail,
|
||||||
|
activate the sending of a notification *****/
|
||||||
if (CreateNotif)
|
if (CreateNotif)
|
||||||
Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_MESSAGE,&UsrDstData,NewMsgCod,
|
Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_MESSAGE,&UsrDstData,NewMsgCod,
|
||||||
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
|
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
|
||||||
0));
|
0));
|
||||||
|
|
||||||
/***** Show an alert indicating that the message has been sent successfully *****/
|
/***** Show an alert indicating that the message has been sent successfully *****/
|
||||||
sprintf (Gbl.Message,NotifyByEmail ? Txt_message_sent_to_X_notified_by_e_mail :
|
sprintf (Gbl.Message,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
|
||||||
Txt_message_sent_to_X_not_notified_by_e_mail,
|
Txt_message_sent_to_X_not_notified_by_email,
|
||||||
UsrDstData.FullName);
|
UsrDstData.FullName);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ void Not_ReceiveNotice (void)
|
||||||
/***** Write message of success *****/
|
/***** Write message of success *****/
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Txt_Notice_created);
|
Lay_ShowAlert (Lay_SUCCESS,Txt_Notice_created);
|
||||||
|
|
||||||
/***** Notify by e-mail about the new notice *****/
|
/***** Notify by email about the new notice *****/
|
||||||
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_NOTICE,NotCod)))
|
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_NOTICE,NotCod)))
|
||||||
Not_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail);
|
Not_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail);
|
||||||
Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (NumUsrsToBeNotifiedByEMail);
|
Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (NumUsrsToBeNotifiedByEMail);
|
||||||
|
@ -901,7 +901,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t Status,unsigned *NumN
|
||||||
if (sscanf (row[0],"%u",&NumNotices) != 1)
|
if (sscanf (row[0],"%u",&NumNotices) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of notices.");
|
Lay_ShowErrorAndExit ("Error when getting number of notices.");
|
||||||
|
|
||||||
/***** Get number of notifications by e-mail *****/
|
/***** Get number of notifications by email *****/
|
||||||
if (row[1])
|
if (row[1])
|
||||||
{
|
{
|
||||||
if (sscanf (row[1],"%u",NumNotif) != 1)
|
if (sscanf (row[1],"%u",NumNotif) != 1)
|
||||||
|
@ -987,7 +987,7 @@ unsigned Not_GetNumNoticesDeleted (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
if (sscanf (row[0],"%u",&NumNotices) != 1)
|
if (sscanf (row[0],"%u",&NumNotices) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of deleted notices.");
|
Lay_ShowErrorAndExit ("Error when getting number of deleted notices.");
|
||||||
|
|
||||||
/***** Get number of notifications by e-mail *****/
|
/***** Get number of notifications by email *****/
|
||||||
if (row[1])
|
if (row[1])
|
||||||
{
|
{
|
||||||
if (sscanf (row[1],"%u",NumNotif) != 1)
|
if (sscanf (row[1],"%u",NumNotif) != 1)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// swad_notification.c: notifications about events, sent by e-mail
|
// swad_notification.c: notifications about events, sent by email
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SWAD (Shared Workspace At a Distance),
|
SWAD (Shared Workspace At a Distance),
|
||||||
|
@ -1165,7 +1165,7 @@ void Ntf_MarkNotifFilesInGroupAsRemoved (long GrpCod)
|
||||||
/********** Get a list with user's codes of all users to be notified *********/
|
/********** Get a list with user's codes of all users to be notified *********/
|
||||||
/********** about an event, and notify them *********/
|
/********** about an event, and notify them *********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Return the number of users notified by e-mail
|
// Return the number of users notified by email
|
||||||
|
|
||||||
unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
|
unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
|
||||||
{
|
{
|
||||||
|
@ -1468,7 +1468,7 @@ static void Ntf_UpdateMyLastAccessToNotifications (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Send all pending notifications by e-mail ******************/
|
/***************** Send all pending notifications by email *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ntf_SendPendingNotifByEMailToAllUsrs (void)
|
void Ntf_SendPendingNotifByEMailToAllUsrs (void)
|
||||||
|
@ -1533,7 +1533,7 @@ void Ntf_SendPendingNotifByEMailToAllUsrs (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************ Send pending notifications of one user by e-mail ***************/
|
/************ Send pending notifications of one user by email ****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsigned *NumNotif,unsigned *NumMails)
|
static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsigned *NumNotif,unsigned *NumMails)
|
||||||
|
@ -1563,7 +1563,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
|
||||||
long Cod;
|
long Cod;
|
||||||
For_ForumType_t ForumType = (For_ForumType_t) 0; // Initialized to avoid warning
|
For_ForumType_t ForumType = (For_ForumType_t) 0; // Initialized to avoid warning
|
||||||
char ForumName[512];
|
char ForumName[512];
|
||||||
char Command[2048]; // Command to execute for sending an e-mail
|
char Command[2048]; // Command to execute for sending an email
|
||||||
int ReturnCode;
|
int ReturnCode;
|
||||||
|
|
||||||
/***** Return 0 notifications and 0 mails when error *****/
|
/***** Return 0 notifications and 0 mails when error *****/
|
||||||
|
@ -1712,9 +1712,9 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
|
||||||
|
|
||||||
fclose (Gbl.Msg.FileMail);
|
fclose (Gbl.Msg.FileMail);
|
||||||
|
|
||||||
/***** Call the command to send an e-mail *****/
|
/***** Call the command to send an email *****/
|
||||||
sprintf (Command,"%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"[%s] %s\" \"%s\"",
|
sprintf (Command,"%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"[%s] %s\" \"%s\"",
|
||||||
Cfg_COMMAND_SEND_AUTOMATIC_E_MAIL,
|
Cfg_COMMAND_SEND_AUTOMATIC_EMAIL,
|
||||||
Cfg_AUTOMATIC_EMAIL_SMTP_SERVER,
|
Cfg_AUTOMATIC_EMAIL_SMTP_SERVER,
|
||||||
Cfg_AUTOMATIC_EMAIL_SMTP_PORT,
|
Cfg_AUTOMATIC_EMAIL_SMTP_PORT,
|
||||||
Cfg_AUTOMATIC_EMAIL_FROM,
|
Cfg_AUTOMATIC_EMAIL_FROM,
|
||||||
|
@ -1725,7 +1725,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
|
||||||
Gbl.Msg.FileNameMail);
|
Gbl.Msg.FileNameMail);
|
||||||
ReturnCode = system (Command);
|
ReturnCode = system (Command);
|
||||||
if (ReturnCode == -1)
|
if (ReturnCode == -1)
|
||||||
Lay_ShowErrorAndExit ("Error when running script to send e-mail.");
|
Lay_ShowErrorAndExit ("Error when running script to send email.");
|
||||||
|
|
||||||
/***** Remove temporary file *****/
|
/***** Remove temporary file *****/
|
||||||
unlink (Gbl.Msg.FileNameMail);
|
unlink (Gbl.Msg.FileNameMail);
|
||||||
|
@ -1773,20 +1773,20 @@ Ntf_NotifyEvent_t Ntf_GetNotifyEventFromDB (const char *Str)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******** Show an alert with the number of users notified by e-mail **********/
|
/******** Show an alert with the number of users notified by email ***********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (unsigned NumUsrsToBeNotifiedByEMail)
|
void Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (unsigned NumUsrsToBeNotifiedByEMail)
|
||||||
{
|
{
|
||||||
extern const char *Txt_No_of_users_who_will_be_notified_by_e_mail;
|
extern const char *Txt_No_of_users_who_will_be_notified_by_email;
|
||||||
|
|
||||||
sprintf (Gbl.Message,"%s: %u",
|
sprintf (Gbl.Message,"%s: %u",
|
||||||
Txt_No_of_users_who_will_be_notified_by_e_mail,NumUsrsToBeNotifiedByEMail);
|
Txt_No_of_users_who_will_be_notified_by_email,NumUsrsToBeNotifiedByEMail);
|
||||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************* Get number of events notified and e-mails sent ****************/
|
/************* Get number of events notified and emails sent *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Ntf_GetNumNotifSent (long DegCod,long CrsCod,
|
static void Ntf_GetNumNotifSent (long DegCod,long CrsCod,
|
||||||
|
@ -1798,20 +1798,20 @@ static void Ntf_GetNumNotifSent (long DegCod,long CrsCod,
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned long NumRows;
|
unsigned long NumRows;
|
||||||
|
|
||||||
/***** Get number of notifications sent by e-mail from database *****/
|
/***** Get number of notifications sent by email from database *****/
|
||||||
sprintf (Query,"SELECT NumEvents,NumMails FROM sta_notif"
|
sprintf (Query,"SELECT NumEvents,NumMails FROM sta_notif"
|
||||||
" WHERE DegCod='%ld' AND CrsCod='%ld' AND NotifyEvent='%u'",
|
" WHERE DegCod='%ld' AND CrsCod='%ld' AND NotifyEvent='%u'",
|
||||||
DegCod,CrsCod,(unsigned) NotifyEvent);
|
DegCod,CrsCod,(unsigned) NotifyEvent);
|
||||||
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get number of notifications sent by e-mail");
|
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get number of notifications sent by email");
|
||||||
|
|
||||||
/***** Get number of rows *****/
|
/***** Get number of rows *****/
|
||||||
if (NumRows)
|
if (NumRows)
|
||||||
{
|
{
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
if (sscanf (row[0],"%u",NumEvents) != 1)
|
if (sscanf (row[0],"%u",NumEvents) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of notifications sent by e-mail.");
|
Lay_ShowErrorAndExit ("Error when getting number of notifications sent by email.");
|
||||||
if (sscanf (row[1],"%u",NumMails) != 1)
|
if (sscanf (row[1],"%u",NumMails) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of notifications sent by e-mail.");
|
Lay_ShowErrorAndExit ("Error when getting number of notifications sent by email.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*NumEvents = *NumMails = 0;
|
*NumEvents = *NumMails = 0;
|
||||||
|
@ -1821,7 +1821,7 @@ static void Ntf_GetNumNotifSent (long DegCod,long CrsCod,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Update number of notify e-mails sent *******************/
|
/******************** Update number of notify emails sent ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Ntf_UpdateNumNotifSent (long DegCod,long CrsCod,
|
static void Ntf_UpdateNumNotifSent (long DegCod,long CrsCod,
|
||||||
|
@ -1864,7 +1864,7 @@ void Ntf_MarkAllNotifAsSeen (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Activate the sending of e-mail to notify me that I have new messages ****/
|
/*** Activate the sending of email to notify me that I have new messages *****/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ntf_PutFormChangeNotifSentByEMail (void)
|
void Ntf_PutFormChangeNotifSentByEMail (void)
|
||||||
|
@ -1874,7 +1874,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
|
||||||
extern const char *Txt_Save_changes;
|
extern const char *Txt_Save_changes;
|
||||||
extern const char *Txt_Notifications;
|
extern const char *Txt_Notifications;
|
||||||
extern const char *Txt_Create_BR_notification;
|
extern const char *Txt_Create_BR_notification;
|
||||||
extern const char *Txt_Notify_me_BR_by_e_mail;
|
extern const char *Txt_Notify_me_BR_by_email;
|
||||||
extern const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS];
|
extern const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS];
|
||||||
Ntf_NotifyEvent_t NotifyEvent;
|
Ntf_NotifyEvent_t NotifyEvent;
|
||||||
|
|
||||||
|
@ -1886,7 +1886,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
Act_FormStart (ActChgNtfPrf);
|
Act_FormStart (ActChgNtfPrf);
|
||||||
|
|
||||||
/***** Warning if I can not receive e-mail notifications *****/
|
/***** Warning if I can not receive email notifications *****/
|
||||||
if (!Mai_CheckIfUsrCanReceiveEmailNotif (&Gbl.Usrs.Me.UsrDat))
|
if (!Mai_CheckIfUsrCanReceiveEmailNotif (&Gbl.Usrs.Me.UsrDat))
|
||||||
Mai_WriteWarningEmailNotifications ();
|
Mai_WriteWarningEmailNotifications ();
|
||||||
|
|
||||||
|
@ -1902,9 +1902,9 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
|
||||||
"</th>"
|
"</th>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Create_BR_notification,
|
Txt_Create_BR_notification,
|
||||||
Txt_Notify_me_BR_by_e_mail);
|
Txt_Notify_me_BR_by_email);
|
||||||
|
|
||||||
/***** Checkbox to activate the sending of e-mail to notify me about events *****/
|
/***** Checkbox to activate the sending of email to notify me about events *****/
|
||||||
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
||||||
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
||||||
NotifyEvent++) // O is reserved for Ntf_EVENT_UNKNOWN
|
NotifyEvent++) // O is reserved for Ntf_EVENT_UNKNOWN
|
||||||
|
@ -1945,7 +1945,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/** Get parameter with the sending of e-mail to notify me that I have msgs. **/
|
/** Get parameter with the sending of email to notify me that I have msgs. ***/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Ntf_GetParamsNotifyEvents (void)
|
static void Ntf_GetParamsNotifyEvents (void)
|
||||||
|
@ -1974,7 +1974,7 @@ static void Ntf_GetParamsNotifyEvents (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**** Change my preference about sending me notify e-mails about events ******/
|
/***** Change my preference about sending me notify emails about events ******/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ntf_ChangeNotifyEvents (void)
|
void Ntf_ChangeNotifyEvents (void)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// swad_notification.h: notifications about events, sent by e-mail
|
// swad_notification.h: notifications about events, sent by email
|
||||||
|
|
||||||
#ifndef _SWAD_NTF
|
#ifndef _SWAD_NTF
|
||||||
#define _SWAD_NTF
|
#define _SWAD_NTF
|
||||||
|
|
|
@ -210,7 +210,7 @@ void Pwd_ActChgMyPwd2 (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*************** Show form to send a new password by e-mail ******************/
|
/*************** Show form to send a new password by email *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Pwd_PutLinkToSendNewPasswd (void)
|
void Pwd_PutLinkToSendNewPasswd (void)
|
||||||
|
@ -229,7 +229,7 @@ static void Pwd_PutLinkToSendNewPasswdParams (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*************** Show form to send a new password by e-mail ******************/
|
/*************** Show form to send a new password by email *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Pwd_ShowFormSendNewPwd (void)
|
void Pwd_ShowFormSendNewPwd (void)
|
||||||
|
@ -267,7 +267,7 @@ void Pwd_ShowFormSendNewPwd (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Send a new password by e-mail ***********************/
|
/*********************** Send a new password by email ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Pwd_ChkIdLoginAndSendNewPwd (void)
|
void Pwd_ChkIdLoginAndSendNewPwd (void)
|
||||||
|
@ -304,7 +304,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
|
||||||
ListUsrCods.Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
ListUsrCods.Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an email
|
||||||
{
|
{
|
||||||
if ((Gbl.Usrs.Me.UsrDat.UsrCod = Mai_GetUsrCodFromEmail (Gbl.Usrs.Me.UsrIdLogin)) > 0)
|
if ((Gbl.Usrs.Me.UsrDat.UsrCod = Mai_GetUsrCodFromEmail (Gbl.Usrs.Me.UsrIdLogin)) > 0)
|
||||||
{
|
{
|
||||||
|
@ -314,7 +314,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
|
||||||
ListUsrCods.Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
ListUsrCods.Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // 3: It's not a nickname nor e-mail
|
else // 3: It's not a nickname nor email
|
||||||
{
|
{
|
||||||
// Users' IDs are always stored internally in capitals and without leading zeros
|
// Users' IDs are always stored internally in capitals and without leading zeros
|
||||||
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
|
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
|
||||||
|
@ -334,7 +334,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Send a new password via e-mail when user exists *****/
|
/***** Send a new password via email when user exists *****/
|
||||||
if (ListUsrCods.NumUsrs)
|
if (ListUsrCods.NumUsrs)
|
||||||
{
|
{
|
||||||
if (ListUsrCods.NumUsrs == 1)
|
if (ListUsrCods.NumUsrs == 1)
|
||||||
|
@ -358,7 +358,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
|
||||||
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
|
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else // I have no e-mail address
|
else // I have no email address
|
||||||
/***** Help message *****/
|
/***** Help message *****/
|
||||||
Lay_ShowAlert (Lay_INFO,Txt_If_you_have_written_your_ID_nickname_or_email_correctly_);
|
Lay_ShowAlert (Lay_INFO,Txt_If_you_have_written_your_ID_nickname_or_email_correctly_);
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Send a new password by e-mail ***********************/
|
/*********************** Send a new password by email ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Gbl.Usrs.Me.UsrDat must be filled
|
// Gbl.Usrs.Me.UsrDat must be filled
|
||||||
// Return code returned by command
|
// Return code returned by command
|
||||||
|
@ -391,7 +391,7 @@ int Pwd_SendNewPasswordByEmail (char NewRandomPlainPassword[Pwd_MAX_LENGTH_PLAIN
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_following_password_has_been_assigned_to_you_to_log_in_X_NO_HTML;
|
extern const char *Txt_The_following_password_has_been_assigned_to_you_to_log_in_X_NO_HTML;
|
||||||
extern const char *Txt_New_password_NO_HTML[1+Txt_NUM_LANGUAGES];
|
extern const char *Txt_New_password_NO_HTML[1+Txt_NUM_LANGUAGES];
|
||||||
char Command[2048]; // Command to execute for sending an e-mail
|
char Command[2048]; // Command to execute for sending an email
|
||||||
int ReturnCode;
|
int ReturnCode;
|
||||||
|
|
||||||
/***** Create temporary file for mail content *****/
|
/***** Create temporary file for mail content *****/
|
||||||
|
@ -415,9 +415,9 @@ int Pwd_SendNewPasswordByEmail (char NewRandomPlainPassword[Pwd_MAX_LENGTH_PLAIN
|
||||||
|
|
||||||
fclose (Gbl.Msg.FileMail);
|
fclose (Gbl.Msg.FileMail);
|
||||||
|
|
||||||
/***** Call the script to send an e-mail *****/
|
/***** Call the script to send an email *****/
|
||||||
sprintf (Command,"%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"[%s] %s\" \"%s\"",
|
sprintf (Command,"%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"[%s] %s\" \"%s\"",
|
||||||
Cfg_COMMAND_SEND_AUTOMATIC_E_MAIL,
|
Cfg_COMMAND_SEND_AUTOMATIC_EMAIL,
|
||||||
Cfg_AUTOMATIC_EMAIL_SMTP_SERVER,
|
Cfg_AUTOMATIC_EMAIL_SMTP_SERVER,
|
||||||
Cfg_AUTOMATIC_EMAIL_SMTP_PORT,
|
Cfg_AUTOMATIC_EMAIL_SMTP_PORT,
|
||||||
Cfg_AUTOMATIC_EMAIL_FROM,
|
Cfg_AUTOMATIC_EMAIL_FROM,
|
||||||
|
@ -428,7 +428,7 @@ int Pwd_SendNewPasswordByEmail (char NewRandomPlainPassword[Pwd_MAX_LENGTH_PLAIN
|
||||||
Gbl.Msg.FileNameMail);
|
Gbl.Msg.FileNameMail);
|
||||||
ReturnCode = system (Command);
|
ReturnCode = system (Command);
|
||||||
if (ReturnCode == -1)
|
if (ReturnCode == -1)
|
||||||
Lay_ShowErrorAndExit ("Error when running script to send e-mail.");
|
Lay_ShowErrorAndExit ("Error when running script to send email.");
|
||||||
|
|
||||||
/***** Remove temporary file *****/
|
/***** Remove temporary file *****/
|
||||||
unlink (Gbl.Msg.FileNameMail);
|
unlink (Gbl.Msg.FileNameMail);
|
||||||
|
|
|
@ -116,7 +116,7 @@ void Pre_EditPrefs (void)
|
||||||
/***** Form to set my preferences on privacy *****/
|
/***** Form to set my preferences on privacy *****/
|
||||||
Pri_EditMyPrivacy ();
|
Pri_EditMyPrivacy ();
|
||||||
|
|
||||||
/***** Automatic e-mail to notify of new events *****/
|
/***** Automatic email to notify of new events *****/
|
||||||
Ntf_PutFormChangeNotifSentByEMail ();
|
Ntf_PutFormChangeNotifSentByEMail ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2108,7 +2108,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"3\">");
|
"<td colspan=\"3\">");
|
||||||
|
|
||||||
/***** Show e-mail and user's ID *****/
|
/***** Show email and user's ID *****/
|
||||||
if (ShowIDRows)
|
if (ShowIDRows)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL CELLS_PAD_2\">");
|
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL CELLS_PAD_2\">");
|
||||||
|
@ -2571,7 +2571,7 @@ static void Rec_ShowWebsAndSocialNets (struct UsrData *UsrDat,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Show user's e-mail ****************************/
|
/***************************** Show user's email *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Rec_ShowEmail (struct UsrData *UsrDat,const char *ClassForm)
|
static void Rec_ShowEmail (struct UsrData *UsrDat,const char *ClassForm)
|
||||||
|
|
|
@ -534,7 +534,7 @@ static void Rep_WriteSectionUsrInfo (void)
|
||||||
Txt_Name,
|
Txt_Name,
|
||||||
Gbl.Usrs.Me.UsrDat.FullName);
|
Gbl.Usrs.Me.UsrDat.FullName);
|
||||||
|
|
||||||
/***** User's e-mail *****/
|
/***** User's email *****/
|
||||||
fprintf (Gbl.F.Rep,"<li>%s: %s</li>",
|
fprintf (Gbl.F.Rep,"<li>%s: %s</li>",
|
||||||
Txt_Email,
|
Txt_Email,
|
||||||
Gbl.Usrs.Me.UsrDat.Email);
|
Gbl.Usrs.Me.UsrDat.Email);
|
||||||
|
|
|
@ -3196,13 +3196,13 @@ static void Soc_CreateNotifToAuthor (long AuthorCod,long PubCod,
|
||||||
UsrDat.UsrCod = AuthorCod;
|
UsrDat.UsrCod = AuthorCod;
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat))
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat))
|
||||||
{
|
{
|
||||||
/***** This fav must be notified by e-mail? *****/
|
/***** This fav must be notified by email? *****/
|
||||||
CreateNotif = (UsrDat.Prefs.NotifNtfEvents & (1 << NotifyEvent));
|
CreateNotif = (UsrDat.Prefs.NotifNtfEvents & (1 << NotifyEvent));
|
||||||
NotifyByEmail = CreateNotif &&
|
NotifyByEmail = CreateNotif &&
|
||||||
(UsrDat.Prefs.EmailNtfEvents & (1 << NotifyEvent));
|
(UsrDat.Prefs.EmailNtfEvents & (1 << NotifyEvent));
|
||||||
|
|
||||||
/***** Create notification for the author of the post.
|
/***** Create notification for the author of the post.
|
||||||
If this author wants to receive notifications by e-mail,
|
If this author wants to receive notifications by email,
|
||||||
activate the sending of a notification *****/
|
activate the sending of a notification *****/
|
||||||
if (CreateNotif)
|
if (CreateNotif)
|
||||||
Ntf_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,PubCod,
|
Ntf_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,PubCod,
|
||||||
|
|
|
@ -7688,7 +7688,7 @@ static void Sta_WriteForumTotalStats (struct Sta_StatsForum *StatsForum)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****** Get and show number of users who want to be notified by e-mail *******/
|
/****** Get and show number of users who want to be notified by email ********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
|
@ -7700,7 +7700,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
extern const char *Txt_No_of_users;
|
extern const char *Txt_No_of_users;
|
||||||
extern const char *Txt_PERCENT_of_users;
|
extern const char *Txt_PERCENT_of_users;
|
||||||
extern const char *Txt_Number_of_BR_events;
|
extern const char *Txt_Number_of_BR_events;
|
||||||
extern const char *Txt_Number_of_BR_e_mails;
|
extern const char *Txt_Number_of_BR_emails;
|
||||||
extern const char *Txt_Total;
|
extern const char *Txt_Total;
|
||||||
Ntf_NotifyEvent_t NotifyEvent;
|
Ntf_NotifyEvent_t NotifyEvent;
|
||||||
char Query[1024];
|
char Query[1024];
|
||||||
|
@ -7740,13 +7740,14 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
Txt_No_of_users,
|
Txt_No_of_users,
|
||||||
Txt_PERCENT_of_users,
|
Txt_PERCENT_of_users,
|
||||||
Txt_Number_of_BR_events,
|
Txt_Number_of_BR_events,
|
||||||
Txt_Number_of_BR_e_mails);
|
Txt_Number_of_BR_emails);
|
||||||
|
|
||||||
/***** Get total number of users *****/
|
/***** Get total number of users *****/
|
||||||
NumUsrsTotal = (Gbl.Scope.Current == Sco_SCOPE_SYS) ? Sta_GetTotalNumberOfUsersInPlatform () :
|
NumUsrsTotal = (Gbl.Scope.Current == Sco_SCOPE_SYS) ? Sta_GetTotalNumberOfUsersInPlatform () :
|
||||||
Sta_GetTotalNumberOfUsersInCourses (Gbl.Scope.Current,Rol_UNKNOWN);
|
Sta_GetTotalNumberOfUsersInCourses (Gbl.Scope.Current,Rol_UNKNOWN);
|
||||||
|
|
||||||
/***** Get total number of users who want to be notified by e-mail on some event, from database *****/
|
/***** Get total number of users who want to be
|
||||||
|
notified by email on some event, from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_SYS:
|
case Sco_SCOPE_SYS:
|
||||||
|
@ -7807,14 +7808,14 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong scope.");
|
Lay_ShowErrorAndExit ("Wrong scope.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent = (unsigned) DB_QueryCOUNT (Query,"can not get the total number of users who want to be notified by e-mail on some event");
|
NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent = (unsigned) DB_QueryCOUNT (Query,"can not get the total number of users who want to be notified by email on some event");
|
||||||
|
|
||||||
/***** For each notify event... *****/
|
/***** For each notify event... *****/
|
||||||
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
||||||
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
||||||
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
||||||
{
|
{
|
||||||
/***** Get the number of users who want to be notified by e-mail on this event, from database *****/
|
/***** Get the number of users who want to be notified by email on this event, from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_SYS:
|
case Sco_SCOPE_SYS:
|
||||||
|
@ -7876,9 +7877,9 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong scope.");
|
Lay_ShowErrorAndExit ("Wrong scope.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
NumUsrs[NotifyEvent] = (unsigned) DB_QueryCOUNT (Query,"can not get the number of users who want to be notified by e-mail on an event");
|
NumUsrs[NotifyEvent] = (unsigned) DB_QueryCOUNT (Query,"can not get the number of users who want to be notified by email on an event");
|
||||||
|
|
||||||
/***** Get number of notifications by e-mail from database *****/
|
/***** Get number of notifications by email from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_SYS:
|
case Sco_SCOPE_SYS:
|
||||||
|
@ -7932,7 +7933,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong scope.");
|
Lay_ShowErrorAndExit ("Wrong scope.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DB_QuerySELECT (Query,&mysql_res,"can not get the number of notifications by e-mail");
|
DB_QuerySELECT (Query,&mysql_res,"can not get the number of notifications by email");
|
||||||
|
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
|
@ -7940,7 +7941,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
if (row[0])
|
if (row[0])
|
||||||
{
|
{
|
||||||
if (sscanf (row[0],"%u",&NumEvents[NotifyEvent]) != 1)
|
if (sscanf (row[0],"%u",&NumEvents[NotifyEvent]) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting the number of notifications by e-mail.");
|
Lay_ShowErrorAndExit ("Error when getting the number of notifications by email.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
NumEvents[NotifyEvent] = 0;
|
NumEvents[NotifyEvent] = 0;
|
||||||
|
@ -7949,7 +7950,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
if (row[1])
|
if (row[1])
|
||||||
{
|
{
|
||||||
if (sscanf (row[1],"%u",&NumMails[NotifyEvent]) != 1)
|
if (sscanf (row[1],"%u",&NumMails[NotifyEvent]) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting the number of e-mails to notify events3.");
|
Lay_ShowErrorAndExit ("Error when getting the number of emails to notify events3.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
NumMails[NotifyEvent] = 0;
|
NumMails[NotifyEvent] = 0;
|
||||||
|
@ -7962,7 +7963,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
NumMailsTotal += NumMails[NotifyEvent];
|
NumMailsTotal += NumMails[NotifyEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who want to be notified by e-mail on each event *****/
|
/***** Write number of users who want to be notified by email on each event *****/
|
||||||
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
||||||
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
||||||
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
||||||
|
@ -7991,7 +7992,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
NumEvents[NotifyEvent],
|
NumEvents[NotifyEvent],
|
||||||
NumMails[NotifyEvent]);
|
NumMails[NotifyEvent]);
|
||||||
|
|
||||||
/***** Write total number of users who want to be notified by e-mail on some event *****/
|
/***** Write total number of users who want to be notified by email on some event *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT_N_LINE_TOP LEFT_MIDDLE\">"
|
"<td class=\"DAT_N_LINE_TOP LEFT_MIDDLE\">"
|
||||||
"%s"
|
"%s"
|
||||||
|
|
|
@ -2783,7 +2783,7 @@ void Str_CreateRandomAlphanumStr (char *Str,size_t Length)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Get mailbox from e-mail address **********************/
|
/********************** Get mailbox from email address ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Str_GetMailBox (const char *Email,char *MailBox,size_t MaxLength)
|
void Str_GetMailBox (const char *Email,char *MailBox,size_t MaxLength)
|
||||||
|
|
|
@ -2207,7 +2207,7 @@ void Svy_RecFormSurvey (void)
|
||||||
else
|
else
|
||||||
Svy_RequestCreatOrEditSvy ();
|
Svy_RequestCreatOrEditSvy ();
|
||||||
|
|
||||||
/***** Notify by e-mail about the new survey *****/
|
/***** Notify by email about the new survey *****/
|
||||||
if (NewSvy.Scope == Sco_SCOPE_CRS) // Notify only the surveys for a course, not for a degree or global
|
if (NewSvy.Scope == Sco_SCOPE_CRS) // Notify only the surveys for a course, not for a degree or global
|
||||||
{
|
{
|
||||||
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_SURVEY,NewSvy.SvyCod)))
|
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_SURVEY,NewSvy.SvyCod)))
|
||||||
|
@ -3939,7 +3939,7 @@ unsigned Svy_GetNumCrsSurveys (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
if (sscanf (row[0],"%u",&NumSurveys) != 1)
|
if (sscanf (row[0],"%u",&NumSurveys) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting number of surveys.");
|
Lay_ShowErrorAndExit ("Error when getting number of surveys.");
|
||||||
|
|
||||||
/***** Get number of notifications by e-mail *****/
|
/***** Get number of notifications by email *****/
|
||||||
if (row[1])
|
if (row[1])
|
||||||
{
|
{
|
||||||
if (sscanf (row[1],"%u",NumNotif) != 1)
|
if (sscanf (row[1],"%u",NumNotif) != 1)
|
||||||
|
|
1328
swad_text.c
1328
swad_text.c
File diff suppressed because it is too large
Load Diff
46
swad_user.c
46
swad_user.c
|
@ -590,7 +590,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
|
||||||
if (sscanf (row[29],"%u",&UsrDat->Prefs.NotifNtfEvents) != 1)
|
if (sscanf (row[29],"%u",&UsrDat->Prefs.NotifNtfEvents) != 1)
|
||||||
UsrDat->Prefs.NotifNtfEvents = (unsigned) -1; // 0xFF..FF
|
UsrDat->Prefs.NotifNtfEvents = (unsigned) -1; // 0xFF..FF
|
||||||
|
|
||||||
/* Get on which events I want to be notified by e-mail */
|
/* Get on which events I want to be notified by email */
|
||||||
if (sscanf (row[30],"%u",&UsrDat->Prefs.EmailNtfEvents) != 1)
|
if (sscanf (row[30],"%u",&UsrDat->Prefs.EmailNtfEvents) != 1)
|
||||||
UsrDat->Prefs.EmailNtfEvents = 0;
|
UsrDat->Prefs.EmailNtfEvents = 0;
|
||||||
if (UsrDat->Prefs.EmailNtfEvents >= (1 << Ntf_NUM_NOTIFY_EVENTS)) // Maximum binary value for NotifyEvents is 000...0011...11
|
if (UsrDat->Prefs.EmailNtfEvents >= (1 << Ntf_NUM_NOTIFY_EVENTS)) // Maximum binary value for NotifyEvents is 000...0011...11
|
||||||
|
@ -612,7 +612,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
/***** Get nickname and e-mail *****/
|
/***** Get nickname and email *****/
|
||||||
Nck_GetNicknameFromUsrCod (UsrDat->UsrCod,UsrDat->Nickname);
|
Nck_GetNicknameFromUsrCod (UsrDat->UsrCod,UsrDat->Nickname);
|
||||||
Mai_GetEmailFromUsrCod (UsrDat);
|
Mai_GetEmailFromUsrCod (UsrDat);
|
||||||
}
|
}
|
||||||
|
@ -1848,7 +1848,7 @@ void Usr_WelcomeUsr (void)
|
||||||
else
|
else
|
||||||
Lay_ShowAlert (Lay_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]);
|
Lay_ShowAlert (Lay_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]);
|
||||||
|
|
||||||
/***** Warning to confirm my e-mail address *****/
|
/***** Warning to confirm my email address *****/
|
||||||
if (Gbl.Usrs.Me.UsrDat.Email[0] &&
|
if (Gbl.Usrs.Me.UsrDat.Email[0] &&
|
||||||
!Gbl.Usrs.Me.UsrDat.EmailConfirmed)
|
!Gbl.Usrs.Me.UsrDat.EmailConfirmed)
|
||||||
Mai_PutButtonToCheckEmailAddress ();
|
Mai_PutButtonToCheckEmailAddress ();
|
||||||
|
@ -2033,7 +2033,7 @@ void Usr_GetParamUsrIdLogin (void)
|
||||||
|
|
||||||
static void Usr_GetParamOtherUsrIDNickOrEMail (void)
|
static void Usr_GetParamOtherUsrIDNickOrEMail (void)
|
||||||
{
|
{
|
||||||
/***** Get parameter with the plain user's ID, @nick or e-mail of another user *****/
|
/***** Get parameter with the plain user's ID, @nick or email of another user *****/
|
||||||
Par_GetParToText ("OtherUsrIDNickOrEMail",Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail,Usr_MAX_BYTES_USR_LOGIN);
|
Par_GetParToText ("OtherUsrIDNickOrEMail",Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail,Usr_MAX_BYTES_USR_LOGIN);
|
||||||
|
|
||||||
// If it's a user's ID (if does not contain '@')
|
// If it's a user's ID (if does not contain '@')
|
||||||
|
@ -2049,7 +2049,7 @@ static void Usr_GetParamOtherUsrIDNickOrEMail (void)
|
||||||
/******* Get parameter user's identificator of other user from a form ********/
|
/******* Get parameter user's identificator of other user from a form ********/
|
||||||
/******* and get user's data ********/
|
/******* and get user's data ********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Returns the number of users for a given ID, @nick or e-mail
|
// Returns the number of users for a given ID, @nick or email
|
||||||
|
|
||||||
unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *ListUsrCods)
|
unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *ListUsrCods)
|
||||||
{
|
{
|
||||||
|
@ -2060,10 +2060,10 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
|
||||||
ListUsrCods->NumUsrs = 0;
|
ListUsrCods->NumUsrs = 0;
|
||||||
ListUsrCods->Lst = NULL;
|
ListUsrCods->Lst = NULL;
|
||||||
|
|
||||||
/***** Get parameter with the plain user's ID, @nick or e-mail of another user *****/
|
/***** Get parameter with the plain user's ID, @nick or email of another user *****/
|
||||||
Usr_GetParamOtherUsrIDNickOrEMail ();
|
Usr_GetParamOtherUsrIDNickOrEMail ();
|
||||||
|
|
||||||
/***** Check if it's an ID, a nickname or an e-mail address *****/
|
/***** Check if it's an ID, a nickname or an email address *****/
|
||||||
if (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0])
|
if (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0])
|
||||||
{
|
{
|
||||||
if (Nck_CheckIfNickWithArrobaIsValid (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail)) // 1: It's a nickname
|
if (Nck_CheckIfNickWithArrobaIsValid (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail)) // 1: It's a nickname
|
||||||
|
@ -2075,7 +2075,7 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
|
||||||
ListUsrCods->Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
ListUsrCods->Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail)) // 2: It's an email
|
||||||
{
|
{
|
||||||
if ((Gbl.Usrs.Other.UsrDat.UsrCod = Mai_GetUsrCodFromEmail (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail)) > 0)
|
if ((Gbl.Usrs.Other.UsrDat.UsrCod = Mai_GetUsrCodFromEmail (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail)) > 0)
|
||||||
{
|
{
|
||||||
|
@ -2084,7 +2084,7 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
|
||||||
ListUsrCods->Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
ListUsrCods->Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // 3: It's not a nickname nor e-mail
|
else // 3: It's not a nickname nor email
|
||||||
{
|
{
|
||||||
// Users' IDs are always stored internally in capitals and without leading zeros
|
// Users' IDs are always stored internally in capitals and without leading zeros
|
||||||
Str_RemoveLeadingZeros (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
|
Str_RemoveLeadingZeros (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
|
||||||
|
@ -2100,7 +2100,7 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
|
||||||
/* Check if user's ID exists in database */
|
/* Check if user's ID exists in database */
|
||||||
ID_GetListUsrCodsFromUsrID (&Gbl.Usrs.Other.UsrDat,NULL,ListUsrCods,false);
|
ID_GetListUsrCodsFromUsrID (&Gbl.Usrs.Other.UsrDat,NULL,ListUsrCods,false);
|
||||||
}
|
}
|
||||||
else // Not a valid user's nickname, e-mail or ID
|
else // Not a valid user's nickname, email or ID
|
||||||
Wrong = true;
|
Wrong = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2109,7 +2109,7 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
|
||||||
|
|
||||||
if (Wrong)
|
if (Wrong)
|
||||||
{
|
{
|
||||||
/***** String is not a valid user's nickname, e-mail or ID *****/
|
/***** String is not a valid user's nickname, email or ID *****/
|
||||||
sprintf (Gbl.Message,Txt_The_ID_nickname_or_email_X_is_not_valid,
|
sprintf (Gbl.Message,Txt_The_ID_nickname_or_email_X_is_not_valid,
|
||||||
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
|
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
|
@ -2247,7 +2247,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
||||||
else
|
else
|
||||||
PutFormLogin = true;
|
PutFormLogin = true;
|
||||||
}
|
}
|
||||||
else if (Gbl.Action.Act == ActAutUsrInt) // Login using @nickname, e-mail or ID from form
|
else if (Gbl.Action.Act == ActAutUsrInt) // Login using @nickname, email or ID from form
|
||||||
{
|
{
|
||||||
if (Usr_ChkUsrAndGetUsrDataFromDirectLogin ()) // User logged in
|
if (Usr_ChkUsrAndGetUsrDataFromDirectLogin ()) // User logged in
|
||||||
{
|
{
|
||||||
|
@ -2349,7 +2349,7 @@ static bool Usr_ChkUsrAndGetUsrDataFromDirectLogin (void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Check if user has typed his user's ID, his nickname or his e-mail address *****/
|
/***** Check if user has typed his user's ID, his nickname or his email address *****/
|
||||||
if (Nck_CheckIfNickWithArrobaIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 1: It's a nickname
|
if (Nck_CheckIfNickWithArrobaIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 1: It's a nickname
|
||||||
{
|
{
|
||||||
// User is trying to log using his/her nickname
|
// User is trying to log using his/her nickname
|
||||||
|
@ -2359,16 +2359,16 @@ static bool Usr_ChkUsrAndGetUsrDataFromDirectLogin (void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an email
|
||||||
{
|
{
|
||||||
// User is trying to log using his/her e-mail
|
// User is trying to log using his/her email
|
||||||
if ((Gbl.Usrs.Me.UsrDat.UsrCod = Mai_GetUsrCodFromEmail (Gbl.Usrs.Me.UsrIdLogin)) <= 0)
|
if ((Gbl.Usrs.Me.UsrDat.UsrCod = Mai_GetUsrCodFromEmail (Gbl.Usrs.Me.UsrIdLogin)) <= 0)
|
||||||
{
|
{
|
||||||
Usr_ShowAlertUsrDoesNotExistsOrWrongPassword ();
|
Usr_ShowAlertUsrDoesNotExistsOrWrongPassword ();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // 3: It's not a nickname nor e-mail
|
else // 3: It's not a nickname nor email
|
||||||
{
|
{
|
||||||
// Users' IDs are always stored internally in capitals and without leading zeros
|
// Users' IDs are always stored internally in capitals and without leading zeros
|
||||||
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
|
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
|
||||||
|
@ -2437,7 +2437,7 @@ static bool Usr_ChkUsrAndGetUsrDataFromDirectLogin (void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // String is not a valid user's nickname, e-mail or ID
|
else // String is not a valid user's nickname, email or ID
|
||||||
{
|
{
|
||||||
Usr_ShowAlertUsrDoesNotExistsOrWrongPassword ();
|
Usr_ShowAlertUsrDoesNotExistsOrWrongPassword ();
|
||||||
return false;
|
return false;
|
||||||
|
@ -3289,7 +3289,7 @@ static void Usr_WriteMainUsrDataExceptUsrID (struct UsrData *UsrDat,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************************** Write user's e-mail ****************************/
|
/**************************** Write user's email *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Usr_WriteEmail (struct UsrData *UsrDat,const char *BgColor)
|
static void Usr_WriteEmail (struct UsrData *UsrDat,const char *BgColor)
|
||||||
|
@ -4843,7 +4843,7 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
|
||||||
extern const char *Txt_There_is_no_user_with_nickname_X;
|
extern const char *Txt_There_is_no_user_with_nickname_X;
|
||||||
extern const char *Txt_There_is_no_user_with_email_X;
|
extern const char *Txt_There_is_no_user_with_email_X;
|
||||||
extern const char *Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email;
|
extern const char *Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email;
|
||||||
extern const char *Txt_There_is_no_user_with_ID_nick_or_e_mail_X;
|
extern const char *Txt_There_is_no_user_with_ID_nick_or_email_X;
|
||||||
extern const char *Txt_The_ID_nickname_or_email_X_is_not_valid;
|
extern const char *Txt_The_ID_nickname_or_email_X_is_not_valid;
|
||||||
size_t LengthSelectedUsrsCods;
|
size_t LengthSelectedUsrsCods;
|
||||||
size_t LengthUsrCod;
|
size_t LengthUsrCod;
|
||||||
|
@ -4902,7 +4902,7 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
|
||||||
Error = true;
|
Error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (UsrIDNickOrEmail)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (UsrIDNickOrEmail)) // 2: It's an email
|
||||||
{
|
{
|
||||||
if ((UsrDat.UsrCod = Mai_GetUsrCodFromEmail (UsrIDNickOrEmail)) > 0)
|
if ((UsrDat.UsrCod = Mai_GetUsrCodFromEmail (UsrIDNickOrEmail)) > 0)
|
||||||
{
|
{
|
||||||
|
@ -4921,7 +4921,7 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
|
||||||
Error = true;
|
Error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // 3: It's not a nickname nor e-mail
|
else // 3: It's not a nickname nor email
|
||||||
{
|
{
|
||||||
// Users' IDs are always stored internally in capitals and without leading zeros
|
// Users' IDs are always stored internally in capitals and without leading zeros
|
||||||
Str_RemoveLeadingZeros (UsrIDNickOrEmail);
|
Str_RemoveLeadingZeros (UsrIDNickOrEmail);
|
||||||
|
@ -4953,14 +4953,14 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
|
||||||
{
|
{
|
||||||
if (WriteErrorMsgs)
|
if (WriteErrorMsgs)
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_There_is_no_user_with_ID_nick_or_e_mail_X,
|
sprintf (Gbl.Message,Txt_There_is_no_user_with_ID_nick_or_email_X,
|
||||||
UsrIDNickOrEmail);
|
UsrIDNickOrEmail);
|
||||||
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
|
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
|
||||||
}
|
}
|
||||||
Error = true;
|
Error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // String is not a valid user's nickname, e-mail or ID
|
else // String is not a valid user's nickname, email or ID
|
||||||
{
|
{
|
||||||
if (WriteErrorMsgs)
|
if (WriteErrorMsgs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
#define Usr_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS 60
|
#define Usr_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS 60
|
||||||
|
|
||||||
#define Usr_MAX_BYTES_USR_EMAIL 127
|
#define Usr_MAX_BYTES_USR_EMAIL 127
|
||||||
#define Usr_MAX_LENGTH_USR_LOGIN 127 // @nick, e-mail or ID
|
#define Usr_MAX_LENGTH_USR_LOGIN 127 // @nick, email or ID
|
||||||
#define Usr_MAX_BYTES_USR_LOGIN 127
|
#define Usr_MAX_BYTES_USR_LOGIN 127
|
||||||
|
|
||||||
#define Usr_MAX_LENGTH_USR_NAME_OR_SURNAME 32
|
#define Usr_MAX_LENGTH_USR_NAME_OR_SURNAME 32
|
||||||
|
@ -113,7 +113,7 @@ struct UsrData
|
||||||
{
|
{
|
||||||
long UsrCod;
|
long UsrCod;
|
||||||
char EncryptedUsrCod [Cry_LENGTH_ENCRYPTED_STR_SHA256_BASE64+1];
|
char EncryptedUsrCod [Cry_LENGTH_ENCRYPTED_STR_SHA256_BASE64+1];
|
||||||
char UsrIDNickOrEmail[Usr_MAX_BYTES_USR_LOGIN+1]; // String to store the ID, nickname or e-mail
|
char UsrIDNickOrEmail[Usr_MAX_BYTES_USR_LOGIN+1]; // String to store the ID, nickname or email
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct ListIDs *List;
|
struct ListIDs *List;
|
||||||
|
|
|
@ -722,10 +722,10 @@ int swad__createAccount (struct soap *soap,
|
||||||
Nck_UpdateMyNick (NewNicknameWithoutArroba);
|
Nck_UpdateMyNick (NewNicknameWithoutArroba);
|
||||||
strcpy (Gbl.Usrs.Me.UsrDat.Nickname,NewNicknameWithoutArroba);
|
strcpy (Gbl.Usrs.Me.UsrDat.Nickname,NewNicknameWithoutArroba);
|
||||||
|
|
||||||
/***** Save e-mail *****/
|
/***** Save email *****/
|
||||||
if (Mai_UpdateEmailInDB (&Gbl.Usrs.Me.UsrDat,userEmail))
|
if (Mai_UpdateEmailInDB (&Gbl.Usrs.Me.UsrDat,userEmail))
|
||||||
{
|
{
|
||||||
/* E-mail updated sucessfully */
|
/* Email updated sucessfully */
|
||||||
strcpy (Gbl.Usrs.Me.UsrDat.Email,userEmail);
|
strcpy (Gbl.Usrs.Me.UsrDat.Email,userEmail);
|
||||||
Gbl.Usrs.Me.UsrDat.EmailConfirmed = false;
|
Gbl.Usrs.Me.UsrDat.EmailConfirmed = false;
|
||||||
}
|
}
|
||||||
|
@ -769,17 +769,17 @@ static int Svc_CheckParamsNewAccount (char *NewNicknameWithArroba, // Input
|
||||||
else // New nickname is not valid
|
else // New nickname is not valid
|
||||||
return Svc_CHECK_NEW_ACCOUNT_NICKNAME_NOT_VALID;
|
return Svc_CHECK_NEW_ACCOUNT_NICKNAME_NOT_VALID;
|
||||||
|
|
||||||
/***** Step 2/3: Check new e-mail *****/
|
/***** Step 2/3: Check new email *****/
|
||||||
if (Mai_CheckIfEmailIsValid (NewEmail)) // New e-mail is valid
|
if (Mai_CheckIfEmailIsValid (NewEmail)) // New email is valid
|
||||||
{
|
{
|
||||||
/***** Check if the new e-mail matches any of the confirmed e-mails of other users *****/
|
/***** Check if the new email matches any of the confirmed emails of other users *****/
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
|
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
|
||||||
" WHERE E_mail='%s' AND Confirmed='Y'",
|
" WHERE E_mail='%s' AND Confirmed='Y'",
|
||||||
NewEmail);
|
NewEmail);
|
||||||
if (DB_QueryCOUNT (Query,"can not check if e-mail already existed")) // An e-mail of another user is the same that my e-mail
|
if (DB_QueryCOUNT (Query,"can not check if email already existed")) // An email of another user is the same that my email
|
||||||
return Svc_CHECK_NEW_ACCOUNT_EMAIL_REGISTERED_BY_ANOTHER_USER;
|
return Svc_CHECK_NEW_ACCOUNT_EMAIL_REGISTERED_BY_ANOTHER_USER;
|
||||||
}
|
}
|
||||||
else // New e-mail is not valid
|
else // New email is not valid
|
||||||
return Svc_CHECK_NEW_ACCOUNT_EMAIL_NOT_VALID;
|
return Svc_CHECK_NEW_ACCOUNT_EMAIL_NOT_VALID;
|
||||||
|
|
||||||
/***** Step 3/3: Check new password *****/
|
/***** Step 3/3: Check new password *****/
|
||||||
|
@ -837,7 +837,7 @@ int swad__loginByUserPasswordKey (struct soap *soap,
|
||||||
if ((ReturnCode = Svc_GetPlgCodFromAppKey ((const char *) appKey)) != SOAP_OK)
|
if ((ReturnCode = Svc_GetPlgCodFromAppKey ((const char *) appKey)) != SOAP_OK)
|
||||||
return ReturnCode;
|
return ReturnCode;
|
||||||
|
|
||||||
/***** Check if user's e-mail, @nickname or ID are valid *****/
|
/***** Check if user's email, @nickname or ID are valid *****/
|
||||||
strncpy (UsrIDNickOrEmail,userID,255);
|
strncpy (UsrIDNickOrEmail,userID,255);
|
||||||
UsrIDNickOrEmail[255] = '\0';
|
UsrIDNickOrEmail[255] = '\0';
|
||||||
if (Nck_CheckIfNickWithArrobaIsValid (UsrIDNickOrEmail)) // 1: It's a nickname
|
if (Nck_CheckIfNickWithArrobaIsValid (UsrIDNickOrEmail)) // 1: It's a nickname
|
||||||
|
@ -852,9 +852,9 @@ int swad__loginByUserPasswordKey (struct soap *soap,
|
||||||
" AND usr_data.Password='%s'",
|
" AND usr_data.Password='%s'",
|
||||||
UsrIDNickOrEmail,userPassword);
|
UsrIDNickOrEmail,userPassword);
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an email
|
||||||
{
|
{
|
||||||
/* User has typed an e-mail */
|
/* User has typed an email */
|
||||||
// TODO: Get only if email confirmed?
|
// TODO: Get only if email confirmed?
|
||||||
sprintf (Query,"SELECT usr_emails.UsrCod"
|
sprintf (Query,"SELECT usr_emails.UsrCod"
|
||||||
" FROM usr_emails,usr_data"
|
" FROM usr_emails,usr_data"
|
||||||
|
@ -863,7 +863,7 @@ int swad__loginByUserPasswordKey (struct soap *soap,
|
||||||
" AND usr_data.Password='%s'",
|
" AND usr_data.Password='%s'",
|
||||||
UsrIDNickOrEmail,userPassword);
|
UsrIDNickOrEmail,userPassword);
|
||||||
}
|
}
|
||||||
else // 3: It's not a nickname nor e-mail
|
else // 3: It's not a nickname nor email
|
||||||
{
|
{
|
||||||
// Users' IDs are always stored internally in capitals and without leading zeros
|
// Users' IDs are always stored internally in capitals and without leading zeros
|
||||||
Str_RemoveLeadingZeros (UsrIDNickOrEmail);
|
Str_RemoveLeadingZeros (UsrIDNickOrEmail);
|
||||||
|
@ -878,7 +878,7 @@ int swad__loginByUserPasswordKey (struct soap *soap,
|
||||||
" AND usr_data.Password='%s'",
|
" AND usr_data.Password='%s'",
|
||||||
UsrIDNickOrEmail,userPassword);
|
UsrIDNickOrEmail,userPassword);
|
||||||
}
|
}
|
||||||
else // String is not a valid user's nickname, e-mail or ID
|
else // String is not a valid user's nickname, email or ID
|
||||||
return soap_receiver_fault (Gbl.soap,
|
return soap_receiver_fault (Gbl.soap,
|
||||||
"Bad log in",
|
"Bad log in",
|
||||||
"User's ID or nickname don't exist or password is wrong");
|
"User's ID or nickname don't exist or password is wrong");
|
||||||
|
@ -1098,7 +1098,7 @@ int swad__loginBySessionKey (struct soap *soap,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Send a new password by e-mail ***********************/
|
/*********************** Send a new password by email ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
int swad__getNewPassword (struct soap *soap,
|
int swad__getNewPassword (struct soap *soap,
|
||||||
|
@ -1124,7 +1124,7 @@ int swad__getNewPassword (struct soap *soap,
|
||||||
if ((ReturnCode = Svc_GetPlgCodFromAppKey ((const char *) appKey)) != SOAP_OK)
|
if ((ReturnCode = Svc_GetPlgCodFromAppKey ((const char *) appKey)) != SOAP_OK)
|
||||||
return ReturnCode;
|
return ReturnCode;
|
||||||
|
|
||||||
/***** Check if user's e-mail, @nickname or ID are valid *****/
|
/***** Check if user's email, @nickname or ID are valid *****/
|
||||||
strncpy (UsrIDNickOrEmail,userID,255);
|
strncpy (UsrIDNickOrEmail,userID,255);
|
||||||
UsrIDNickOrEmail[255] = '\0';
|
UsrIDNickOrEmail[255] = '\0';
|
||||||
if (Nck_CheckIfNickWithArrobaIsValid (UsrIDNickOrEmail)) // 1: It's a nickname
|
if (Nck_CheckIfNickWithArrobaIsValid (UsrIDNickOrEmail)) // 1: It's a nickname
|
||||||
|
@ -1137,16 +1137,16 @@ int swad__getNewPassword (struct soap *soap,
|
||||||
" WHERE Nickname='%s'",
|
" WHERE Nickname='%s'",
|
||||||
UsrIDNickOrEmail);
|
UsrIDNickOrEmail);
|
||||||
}
|
}
|
||||||
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an e-mail
|
else if (Mai_CheckIfEmailIsValid (Gbl.Usrs.Me.UsrIdLogin)) // 2: It's an email
|
||||||
{
|
{
|
||||||
/* User has typed an e-mail */
|
/* User has typed an email */
|
||||||
// TODO: Get only if email confirmed?
|
// TODO: Get only if email confirmed?
|
||||||
sprintf (Query,"SELECT UsrCod"
|
sprintf (Query,"SELECT UsrCod"
|
||||||
" FROM usr_emails"
|
" FROM usr_emails"
|
||||||
" WHERE E_mail='%s'",
|
" WHERE E_mail='%s'",
|
||||||
UsrIDNickOrEmail);
|
UsrIDNickOrEmail);
|
||||||
}
|
}
|
||||||
else // 3: It's not a nickname nor e-mail
|
else // 3: It's not a nickname nor email
|
||||||
{
|
{
|
||||||
// Users' IDs are always stored internally in capitals and without leading zeros
|
// Users' IDs are always stored internally in capitals and without leading zeros
|
||||||
Str_RemoveLeadingZeros (UsrIDNickOrEmail);
|
Str_RemoveLeadingZeros (UsrIDNickOrEmail);
|
||||||
|
@ -1160,10 +1160,10 @@ int swad__getNewPassword (struct soap *soap,
|
||||||
" WHERE UsrID='%s'",
|
" WHERE UsrID='%s'",
|
||||||
UsrIDNickOrEmail);
|
UsrIDNickOrEmail);
|
||||||
}
|
}
|
||||||
else // String is not a valid user's nickname, e-mail or ID
|
else // String is not a valid user's nickname, email or ID
|
||||||
return soap_receiver_fault (Gbl.soap,
|
return soap_receiver_fault (Gbl.soap,
|
||||||
"Bad log in",
|
"Bad log in",
|
||||||
"User's e-mail, nickname or ID don't exist");
|
"User's email, nickname or ID don't exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Get user's data from database *****/
|
/***** Get user's data from database *****/
|
||||||
|
@ -3285,7 +3285,7 @@ int swad__sendMessage (struct soap *soap,
|
||||||
/* Get recipient data */
|
/* Get recipient data */
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat))
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat))
|
||||||
{
|
{
|
||||||
/* This received message must be notified by e-mail? */
|
/* This received message must be notified by email? */
|
||||||
NotifyByEmail = ((Gbl.Usrs.Other.UsrDat.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) &&
|
NotifyByEmail = ((Gbl.Usrs.Other.UsrDat.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) &&
|
||||||
(Gbl.Usrs.Other.UsrDat.Prefs.EmailNtfEvents & (1 << Ntf_EVENT_MESSAGE)));
|
(Gbl.Usrs.Other.UsrDat.Prefs.EmailNtfEvents & (1 << Ntf_EVENT_MESSAGE)));
|
||||||
|
|
||||||
|
@ -3356,7 +3356,7 @@ static int Svc_SendMessageToUsr (long OriginalMsgCod,
|
||||||
DB_QueryINSERT (Query,"can not create received message");
|
DB_QueryINSERT (Query,"can not create received message");
|
||||||
|
|
||||||
/***** Create notification for this recipient.
|
/***** Create notification for this recipient.
|
||||||
If this recipient wants to receive notifications by e-mail, activate the sending of a notification *****/
|
If this recipient wants to receive notifications by email, activate the sending of a notification *****/
|
||||||
sprintf (Query,"INSERT INTO notif (NotifyEvent,ToUsrCod,FromUsrCod,InsCod,DegCod,CrsCod,Cod,TimeNotif,Status)"
|
sprintf (Query,"INSERT INTO notif (NotifyEvent,ToUsrCod,FromUsrCod,InsCod,DegCod,CrsCod,Cod,TimeNotif,Status)"
|
||||||
" VALUES ('%u','%ld','%ld','-1','-1','-1','%ld',NOW(),'%u')",
|
" VALUES ('%u','%ld','%ld','-1','-1','-1','%ld',NOW(),'%u')",
|
||||||
(unsigned) Ntf_EVENT_MESSAGE,
|
(unsigned) Ntf_EVENT_MESSAGE,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user