mirror of https://github.com/acanas/swad-core.git
Version 15.39
This commit is contained in:
parent
c903dd88a2
commit
8626064672
|
@ -408,7 +408,7 @@ void ID_ShowFormOthIDs (void)
|
|||
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
/***** Form with the user's ID *****/
|
||||
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">");
|
||||
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">");
|
||||
ID_ShowFormChangeUsrID (&Gbl.Usrs.Other.UsrDat,
|
||||
(Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me?
|
||||
fprintf (Gbl.F.Out,"</table>");
|
||||
|
@ -462,7 +462,7 @@ void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,bool ItsMe)
|
|||
{
|
||||
/* Form to remove user's ID */
|
||||
if (ItsMe)
|
||||
Act_FormStart (ActRemIDMe);
|
||||
Act_FormStart (ActRemID_Me);
|
||||
else
|
||||
{
|
||||
Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActRemID_Std :
|
||||
|
@ -684,7 +684,7 @@ void ID_NewOtherUsrID (void)
|
|||
/***** Get other user's code from form and get user's data *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
/***** Remove user's ID *****/
|
||||
/***** New user's ID *****/
|
||||
ID_NewUsrID (&Gbl.Usrs.Other.UsrDat,
|
||||
(Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me?
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ void Acc_ShowFormChangeMyAccount (void)
|
|||
/***** Get current user's nickname and e-mail address
|
||||
It's necessary because current nickname or e-mail could be just updated *****/
|
||||
Nck_GetNicknameFromUsrCod (Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.Nickname);
|
||||
Mai_GetEmailFromUsrCod (Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.Email,&(Gbl.Usrs.Me.UsrDat.EmailConfirmed));
|
||||
Mai_GetEmailFromUsrCod (&Gbl.Usrs.Me.UsrDat);
|
||||
|
||||
/***** Check nickname and e-mail *****/
|
||||
if (!Gbl.Usrs.Me.UsrDat.Nickname[0])
|
||||
|
@ -221,7 +221,7 @@ void Acc_ShowFormChangeMyAccount (void)
|
|||
Acc_PrintAccountSeparator ();
|
||||
|
||||
/***** E-mail *****/
|
||||
Mai_ShowFormChangeUsrEmail ();
|
||||
Mai_ShowFormChangeUsrEmail (&Gbl.Usrs.Me.UsrDat,true);
|
||||
|
||||
/***** Separator *****/
|
||||
Acc_PrintAccountSeparator ();
|
||||
|
|
|
@ -980,6 +980,17 @@ Users:
|
|||
813. ActChgPwdOth Change the password of another user
|
||||
814. ActChgPwdStd Change the password of another user
|
||||
815. ActChgPwdTch Change the password of another user
|
||||
|
||||
------> 801. ActFrmMaiOth Show form to the change of the e-mail of another user
|
||||
------> 802. ActFrmMaiStd Show form to the change of the e-mail of another user
|
||||
------> 803. ActFrmMaiTch Show form to the change of the e-mail of another user
|
||||
------> 804. ActRemMaiOth Remove one of the e-mail of another user
|
||||
------> 805. ActRemMaiStd Remove one of the e-mail of another user
|
||||
------> 806. ActRemMaiTch Remove one of the e-mail of another user
|
||||
------> 807. ActNewMaiOth Create a new user's e-mail for another user
|
||||
------> 808. ActNewMaiStd Create a new user's e-mail for another user
|
||||
------> 809. ActNewMaiTch Create a new user's e-mail for another user
|
||||
|
||||
816. ActRemStdCrs Remove a student from the current course
|
||||
817. ActRemTchCrs Remove a teacher from the current course
|
||||
818. ActRemUsrGbl Eliminate completely a user from the platform
|
||||
|
@ -1224,12 +1235,12 @@ Profile:
|
|||
1047. ActChgMyRol Change type of logged user
|
||||
|
||||
1048. ActCreUsrAcc Create new user account
|
||||
1049. ActRemIDMe Remove one of my user's IDs
|
||||
1049. ActRemID_Me Remove one of my user's IDs
|
||||
1050. ActNewIDMe Create a new user's ID for me
|
||||
1051. ActRemOldNic Remove one of my old nicknames
|
||||
1052. ActChgNic Change my nickname
|
||||
1053. ActRemOldMai Remove one of my old e-mails
|
||||
1054. ActChgMai Change my e-mail address
|
||||
1053. ActRemMaiMe Remove one of my old e-mails
|
||||
1054. ActNewMaiMe Change my e-mail address
|
||||
1055. ActCnfMai Confirm e-mail address
|
||||
1056. ActFrmChgMyPwd Show form to the change of the password
|
||||
1057. ActChgPwd Change the password
|
||||
|
@ -2401,11 +2412,9 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActFrmIDsOth */{1447,-1,TabUsr,ActLstOth ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_ShowFormOthIDs ,NULL},
|
||||
/* ActFrmIDsStd */{1448,-1,TabUsr,ActLstStd ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_ShowFormOthIDs ,NULL},
|
||||
/* ActFrmIDsTch */{1449,-1,TabUsr,ActLstTch ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_ShowFormOthIDs ,NULL},
|
||||
|
||||
/* ActRemID_Oth */{1450,-1,TabUsr,ActLstOth ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_RemoveOtherUsrID ,NULL},
|
||||
/* ActRemID_Std */{1451,-1,TabUsr,ActLstStd ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_RemoveOtherUsrID ,NULL},
|
||||
/* ActRemID_Tch */{1452,-1,TabUsr,ActLstTch ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_RemoveOtherUsrID ,NULL},
|
||||
|
||||
/* ActNewID_Oth */{1453,-1,TabUsr,ActLstOth ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_NewOtherUsrID ,NULL},
|
||||
/* ActNewID_Std */{1454,-1,TabUsr,ActLstStd ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_NewOtherUsrID ,NULL},
|
||||
/* ActNewID_Tch */{1455,-1,TabUsr,ActLstTch ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_NewOtherUsrID ,NULL},
|
||||
|
@ -2417,6 +2426,16 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActChgPwdStd */{1468,-1,TabUsr,ActLstStd ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,Pwd_UpdateOtherPwd1 ,Pwd_UpdateOtherPwd2 ,NULL},
|
||||
/* ActChgPwdTch */{1469,-1,TabUsr,ActLstTch ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,Pwd_UpdateOtherPwd1 ,Pwd_UpdateOtherPwd2 ,NULL},
|
||||
|
||||
/* ActFrmMaiOth */{1475,-1,TabUsr,ActLstOth ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_ShowFormOthEmail ,NULL},
|
||||
/* ActFrmMaiStd */{1476,-1,TabUsr,ActLstStd ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_ShowFormOthEmail ,NULL},
|
||||
/* ActFrmMaiTch */{1477,-1,TabUsr,ActLstTch ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_ShowFormOthEmail ,NULL},
|
||||
/* ActRemMaiOth */{1478,-1,TabUsr,ActLstOth ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_RemoveOtherUsrEmail ,NULL},
|
||||
/* ActRemMaiStd */{1479,-1,TabUsr,ActLstStd ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_RemoveOtherUsrEmail ,NULL},
|
||||
/* ActRemMaiTch */{1480,-1,TabUsr,ActLstTch ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_RemoveOtherUsrEmail ,NULL},
|
||||
/* ActNewMaiOth */{1481,-1,TabUsr,ActLstOth ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_NewOtherUsrEmail ,NULL},
|
||||
/* ActNewMaiStd */{1482,-1,TabUsr,ActLstStd ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_NewOtherUsrEmail ,NULL},
|
||||
/* ActNewMaiTch */{1483,-1,TabUsr,ActLstTch ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_NewOtherUsrEmail ,NULL},
|
||||
|
||||
/* ActRemStdCrs */{1462,-1,TabUsr,ActLstStd ,0x1F8,0x1E0,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemUsrFromCrs ,NULL},
|
||||
/* ActRemTchCrs */{1463,-1,TabUsr,ActLstTch ,0x1F0,0x1E0,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemUsrFromCrs ,NULL},
|
||||
|
||||
|
@ -2693,14 +2712,14 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
|
||||
/* ActCreUsrAcc */{1163,-1,TabPrf,ActFrmUsrAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_AfterCreationNewAccount ,NULL},
|
||||
|
||||
/* ActRemIDMe */{1147,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_RemoveMyUsrID ,NULL},
|
||||
/* ActRemID_Me */{1147,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_RemoveMyUsrID ,NULL},
|
||||
/* ActNewIDMe */{1148,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_NewMyUsrID ,NULL},
|
||||
|
||||
/* ActRemOldNic */{1089,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Nck_RemoveNick ,NULL},
|
||||
/* ActChgNic */{ 37,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Nck_UpdateNick ,NULL},
|
||||
|
||||
/* ActRemOldMai */{1090,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_RemoveEmail ,NULL},
|
||||
/* ActChgMai */{1088,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_UpdateEmail ,NULL},
|
||||
/* ActRemMaiMe */{1090,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_RemoveMyUsrEmail ,NULL},
|
||||
/* ActNewMaiMe */{1088,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,May_NewMyUsrEmail ,NULL},
|
||||
/* ActCnfMai */{1091,-1,TabPrf,ActFrmUsrAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_ConfirmEmail ,NULL},
|
||||
|
||||
/* ActFrmChgMyPwd */{ 34,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Pwd_ShowFormChgPwd ,NULL},
|
||||
|
@ -3860,9 +3879,9 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
|
|||
ActSeeOneTstExaMe, // #1085
|
||||
ActReqDatSeeMrkCrs, // #1086
|
||||
ActReqDatSeeMrkGrp, // #1087
|
||||
ActChgMai, // #1088
|
||||
ActNewMaiMe, // #1088
|
||||
ActRemOldNic, // #1089
|
||||
ActRemOldMai, // #1090
|
||||
ActRemMaiMe, // #1090
|
||||
ActCnfMai, // #1091
|
||||
ActChgIco, // #1092
|
||||
ActRchTxtEdiCrsInf, // #1093
|
||||
|
@ -3919,7 +3938,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
|
|||
ActChgBanImg, // #1144
|
||||
ActClkBan, // #1145
|
||||
ActMrkNtfSee, // #1146
|
||||
ActRemIDMe, // #1147
|
||||
ActRemID_Me, // #1147
|
||||
ActNewIDMe, // #1148
|
||||
ActSeeDegInf, // #1149
|
||||
ActPrnDegInf, // #1150
|
||||
|
@ -4250,6 +4269,15 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
|
|||
ActReqRemNot, // #1472
|
||||
ActSeeLstMyAtt, // #1473
|
||||
ActPrnLstMyAtt, // #1474
|
||||
ActFrmMaiOth, // #1475
|
||||
ActFrmMaiStd, // #1476
|
||||
ActFrmMaiTch, // #1477
|
||||
ActRemMaiOth, // #1478
|
||||
ActRemMaiStd, // #1479
|
||||
ActRemMaiTch, // #1480
|
||||
ActNewMaiOth, // #1481
|
||||
ActNewMaiStd, // #1482
|
||||
ActNewMaiTch, // #1483
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -70,9 +70,9 @@ typedef enum
|
|||
|
||||
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||
|
||||
#define Act_NUM_ACTIONS (7+52+15+90+73+68+204+182+145+171+27+79)
|
||||
#define Act_NUM_ACTIONS (7+52+15+90+73+68+204+182+154+171+27+79)
|
||||
|
||||
#define Act_MAX_ACTION_COD 1474
|
||||
#define Act_MAX_ACTION_COD 1483
|
||||
|
||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
|
||||
|
||||
|
@ -1009,29 +1009,39 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
|
|||
#define ActChgPwdOth (ActChgNumRowFooGrp+125)
|
||||
#define ActChgPwdStd (ActChgNumRowFooGrp+126)
|
||||
#define ActChgPwdTch (ActChgNumRowFooGrp+127)
|
||||
#define ActRemStdCrs (ActChgNumRowFooGrp+128)
|
||||
#define ActRemTchCrs (ActChgNumRowFooGrp+129)
|
||||
#define ActRemUsrGbl (ActChgNumRowFooGrp+130)
|
||||
#define ActFrmMaiOth (ActChgNumRowFooGrp+128)
|
||||
#define ActFrmMaiStd (ActChgNumRowFooGrp+129)
|
||||
#define ActFrmMaiTch (ActChgNumRowFooGrp+130)
|
||||
#define ActRemMaiOth (ActChgNumRowFooGrp+131)
|
||||
#define ActRemMaiStd (ActChgNumRowFooGrp+132)
|
||||
#define ActRemMaiTch (ActChgNumRowFooGrp+133)
|
||||
#define ActNewMaiOth (ActChgNumRowFooGrp+134)
|
||||
#define ActNewMaiStd (ActChgNumRowFooGrp+135)
|
||||
#define ActNewMaiTch (ActChgNumRowFooGrp+136)
|
||||
|
||||
#define ActReqRemAllStdCrs (ActChgNumRowFooGrp+131)
|
||||
#define ActRemAllStdCrs (ActChgNumRowFooGrp+132)
|
||||
#define ActRemStdCrs (ActChgNumRowFooGrp+137)
|
||||
#define ActRemTchCrs (ActChgNumRowFooGrp+138)
|
||||
#define ActRemUsrGbl (ActChgNumRowFooGrp+139)
|
||||
|
||||
#define ActReqRemOldUsr (ActChgNumRowFooGrp+133)
|
||||
#define ActRemOldUsr (ActChgNumRowFooGrp+134)
|
||||
#define ActReqRemAllStdCrs (ActChgNumRowFooGrp+140)
|
||||
#define ActRemAllStdCrs (ActChgNumRowFooGrp+141)
|
||||
|
||||
#define ActLstClk (ActChgNumRowFooGrp+135)
|
||||
#define ActReqRemOldUsr (ActChgNumRowFooGrp+142)
|
||||
#define ActRemOldUsr (ActChgNumRowFooGrp+143)
|
||||
|
||||
#define ActSeePubPrf (ActChgNumRowFooGrp+136)
|
||||
#define ActCal1stClkTim (ActChgNumRowFooGrp+137)
|
||||
#define ActCalNumClk (ActChgNumRowFooGrp+138)
|
||||
#define ActCalNumFilVie (ActChgNumRowFooGrp+139)
|
||||
#define ActCalNumForPst (ActChgNumRowFooGrp+140)
|
||||
#define ActCalNumMsgSnt (ActChgNumRowFooGrp+141)
|
||||
#define ActLstClk (ActChgNumRowFooGrp+144)
|
||||
|
||||
#define ActFolUsr (ActChgNumRowFooGrp+142)
|
||||
#define ActUnfUsr (ActChgNumRowFooGrp+143)
|
||||
#define ActSeeFlg (ActChgNumRowFooGrp+144)
|
||||
#define ActSeeFlr (ActChgNumRowFooGrp+145)
|
||||
#define ActSeePubPrf (ActChgNumRowFooGrp+145)
|
||||
#define ActCal1stClkTim (ActChgNumRowFooGrp+146)
|
||||
#define ActCalNumClk (ActChgNumRowFooGrp+147)
|
||||
#define ActCalNumFilVie (ActChgNumRowFooGrp+148)
|
||||
#define ActCalNumForPst (ActChgNumRowFooGrp+149)
|
||||
#define ActCalNumMsgSnt (ActChgNumRowFooGrp+150)
|
||||
|
||||
#define ActFolUsr (ActChgNumRowFooGrp+151)
|
||||
#define ActUnfUsr (ActChgNumRowFooGrp+152)
|
||||
#define ActSeeFlg (ActChgNumRowFooGrp+153)
|
||||
#define ActSeeFlr (ActChgNumRowFooGrp+154)
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************* Messages tab ********************************/
|
||||
|
@ -1266,12 +1276,12 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
|
|||
#define ActSndNewPwd (ActSeeAllStaCrs+15)
|
||||
#define ActChgMyRol (ActSeeAllStaCrs+16)
|
||||
#define ActCreUsrAcc (ActSeeAllStaCrs+17)
|
||||
#define ActRemIDMe (ActSeeAllStaCrs+18)
|
||||
#define ActRemID_Me (ActSeeAllStaCrs+18)
|
||||
#define ActNewIDMe (ActSeeAllStaCrs+19)
|
||||
#define ActRemOldNic (ActSeeAllStaCrs+20)
|
||||
#define ActChgNic (ActSeeAllStaCrs+21)
|
||||
#define ActRemOldMai (ActSeeAllStaCrs+22)
|
||||
#define ActChgMai (ActSeeAllStaCrs+23)
|
||||
#define ActRemMaiMe (ActSeeAllStaCrs+22)
|
||||
#define ActNewMaiMe (ActSeeAllStaCrs+23)
|
||||
#define ActCnfMai (ActSeeAllStaCrs+24)
|
||||
#define ActFrmChgMyPwd (ActSeeAllStaCrs+25)
|
||||
#define ActChgPwd (ActSeeAllStaCrs+26)
|
||||
|
|
|
@ -107,16 +107,29 @@
|
|||
// TODO: Show message indicating that mail could be in SPAM folder
|
||||
// TODO: Remove email address for recipients rejected (mailbox unavailable)
|
||||
// TODO: List institution and centre admins
|
||||
// TODO: List of degrees administrated by a degree admin should be ordered by name
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.38.3 (2015/11/15)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.39 (2015/11/16)"
|
||||
|
||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 15.39: Nov 16, 2015 Administrators can edit another user' e-mails. (187268 lines)
|
||||
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 ('1476','es','N','Solicitar edición dir. correo estudiante');
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1477','es','N','Solicitar edición dir. correo profesor');
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1478','es','N','Eliminar dir. correo invitado');
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1479','es','N','Eliminar dir. correo estudiante');
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1480','es','N','Eliminar dir. correo profesor');
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1481','es','N','Cambiar dir. correo invitado');
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1482','es','N','Cambiar dir. correo estudiante');
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1483','es','N','Cambiar dir. correo profesor');
|
||||
|
||||
Version 15.38.3: Nov 15, 2015 Changes in listing of places. (187073 lines)
|
||||
Version 15.38.2: Nov 15, 2015 Fixed bug in user's privacy preferences. (187071 lines)
|
||||
Version 15.38.1: Nov 14, 2015 Changes in permission to query the whole range of dates in stats, suggested by Francisco Ocaña Lara. (187073 lines)
|
||||
|
|
|
@ -3000,8 +3000,9 @@ static void Enr_ShowFormToEditOtherUsr (void)
|
|||
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
|
||||
if (Pwd_CheckIfICanChangeOtherUsrPassword (Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||
{
|
||||
ID_PutLinkToChangeUsrIDs (); // Put link (form) to change user's IDs
|
||||
Pwd_PutLinkToChangeOtherUsrPassword (); // Put link (form) to change user's password
|
||||
Mai_PutLinkToChangeOtherUsrEmail (); // Put link (form) to change user's e-mail
|
||||
ID_PutLinkToChangeUsrIDs (); // Put link (form) to change user's IDs
|
||||
}
|
||||
Pho_PutLinkToChangeOtherUsrPhoto (); // Put link (form) to change user's photo
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
|
354
swad_mail.c
354
swad_mail.c
|
@ -75,7 +75,9 @@ static void Mai_PutFormToCreateMailDomain (void);
|
|||
static void Mai_PutHeadMailDomains (void);
|
||||
static void Mai_CreateMailDomain (struct Mail *Mai);
|
||||
|
||||
static void Mai_RemoveEmailFromDB (const char *Email);
|
||||
static void Mai_RemoveEmail (const struct UsrData *UsrDat);
|
||||
static void Mai_RemoveEmailFromDB (long UsrCod,const char *Email);
|
||||
static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe);
|
||||
static void Mai_InsertMailKey (const char *Email,const char MailKey[Mai_LENGTH_EMAIL_CONFIRM_KEY+1]);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -825,7 +827,7 @@ bool Mai_CheckIfEmailIsValid (const char *Email)
|
|||
/********** Get e-mail address of a user from his/her user's code ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Mai_GetEmailFromUsrCod (long UsrCod,char *Email,bool *Confirmed)
|
||||
bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat)
|
||||
{
|
||||
char Query[256];
|
||||
MYSQL_RES *mysql_res;
|
||||
|
@ -836,13 +838,13 @@ bool Mai_GetEmailFromUsrCod (long UsrCod,char *Email,bool *Confirmed)
|
|||
/***** Get current (last updated) user's nickname from database *****/
|
||||
sprintf (Query,"SELECT E_mail,Confirmed FROM usr_emails"
|
||||
" WHERE UsrCod='%ld' ORDER BY CreatTime DESC LIMIT 1",
|
||||
UsrCod);
|
||||
UsrDat->UsrCod);
|
||||
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get e-mail address");
|
||||
|
||||
if (NumRows == 0)
|
||||
{
|
||||
*Email = '\0';
|
||||
*Confirmed = false;
|
||||
UsrDat->Email[0] = '\0';
|
||||
UsrDat->EmailConfirmed = false;
|
||||
Found = false;
|
||||
}
|
||||
else
|
||||
|
@ -850,9 +852,9 @@ bool Mai_GetEmailFromUsrCod (long UsrCod,char *Email,bool *Confirmed)
|
|||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* Get e-mail */
|
||||
strcpy (Email,row[0]);
|
||||
strcpy (UsrDat->Email,row[0]);
|
||||
|
||||
*Confirmed = (Str_ConvertToUpperLetter (row[1][0]) == 'Y');
|
||||
UsrDat->EmailConfirmed = (Str_ConvertToUpperLetter (row[1][0]) == 'Y');
|
||||
|
||||
Found = true;
|
||||
}
|
||||
|
@ -907,11 +909,67 @@ long Mai_GetUsrCodFromEmail (const char *Email)
|
|||
return UsrCod;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Put a link to the action used to change user's e-mail ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Mai_PutLinkToChangeOtherUsrEmail (void)
|
||||
{
|
||||
extern const char *Txt_Change_email;
|
||||
|
||||
/***** Link for changing the password *****/
|
||||
if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me
|
||||
Act_PutContextualLink (ActFrmUsrAcc,NULL,
|
||||
"msg",Txt_Change_email);
|
||||
else // Not me
|
||||
Act_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActFrmMaiStd :
|
||||
(Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER ? ActFrmMaiTch :
|
||||
ActFrmMaiOth),
|
||||
Usr_PutParamOtherUsrCodEncrypted,
|
||||
"msg",Txt_Change_email);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********** Show form to the change the e-mail of another user **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Mai_ShowFormOthEmail (void)
|
||||
{
|
||||
extern const char *Txt_Email;
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
|
||||
/***** Get user whose password must be changed *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
if (Pwd_CheckIfICanChangeOtherUsrPassword (Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||
{
|
||||
/***** Start frame *****/
|
||||
Lay_StartRoundFrame (NULL,Txt_Email);
|
||||
|
||||
/***** Show user's record *****/
|
||||
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
/***** Form with the user's e-mail *****/
|
||||
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">");
|
||||
Mai_ShowFormChangeUsrEmail (&Gbl.Usrs.Other.UsrDat,
|
||||
(Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me?
|
||||
fprintf (Gbl.F.Out,"</table>");
|
||||
|
||||
/***** End frame *****/
|
||||
Lay_EndRoundFrame ();
|
||||
}
|
||||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
else // User not found
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Show form to change my e-mail ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Mai_ShowFormChangeUsrEmail (void)
|
||||
void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe)
|
||||
{
|
||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||
extern const char *Txt_Current_email;
|
||||
|
@ -934,7 +992,7 @@ void Mai_ShowFormChangeUsrEmail (void)
|
|||
sprintf (Query,"SELECT E_mail,Confirmed FROM usr_emails"
|
||||
" WHERE UsrCod='%ld'"
|
||||
" ORDER BY CreatTime DESC",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
UsrDat->UsrCod);
|
||||
NumEmails = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get old e-mail addresses of a user");
|
||||
|
||||
/***** List my e-mails *****/
|
||||
|
@ -968,8 +1026,16 @@ void Mai_ShowFormChangeUsrEmail (void)
|
|||
"<td class=\"LEFT_TOP\">"
|
||||
"<div class=\"FORM_ACCOUNT\">");
|
||||
|
||||
/* Form to remove old e-mail */
|
||||
Act_FormStart (ActRemOldMai);
|
||||
/* Form to remove e-mail */
|
||||
if (ItsMe)
|
||||
Act_FormStart (ActRemMaiMe);
|
||||
else
|
||||
{
|
||||
Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActRemMaiStd :
|
||||
(UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ActRemMaiTch :
|
||||
ActRemMaiOth)); // Guest, visitor or admin
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<input type=\"hidden\" name=\"Email\" value=\"%s\" />",
|
||||
row[0]);
|
||||
Lay_PutIconRemove ();
|
||||
|
@ -993,20 +1059,24 @@ void Mai_ShowFormChangeUsrEmail (void)
|
|||
Gbl.Title,Gbl.Title);
|
||||
}
|
||||
|
||||
/* Link to QR code */
|
||||
// if (NumEmail == 1 && Gbl.Usrs.Me.UsrDat.Email[0] && Confirmed)
|
||||
// QR_PutLinkToPrintMyQRCode (QR_EMAIL);
|
||||
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* Form to change the email */
|
||||
if (NumEmail > 1 || !Confirmed)
|
||||
/* Form to change user's e-mail */
|
||||
if (NumEmail > 1 || (ItsMe && !Confirmed))
|
||||
{
|
||||
Act_FormStart (ActChgMai);
|
||||
if (ItsMe)
|
||||
Act_FormStart (ActNewMaiMe);
|
||||
else
|
||||
{
|
||||
Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActNewMaiStd :
|
||||
(UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ActNewMaiTch :
|
||||
ActNewMaiOth)); // Guest, visitor or admin
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<input type=\"hidden\" name=\"NewEmail\" value=\"%s\" />",
|
||||
row[0]); // E-mail
|
||||
Lay_PutConfirmButtonInline (NumEmail == 1 ? Txt_Confirm_email :
|
||||
Txt_Use_this_email);
|
||||
Lay_PutConfirmButtonInline ((ItsMe && NumEmail == 1) ? Txt_Confirm_email :
|
||||
Txt_Use_this_email);
|
||||
Act_FormEnd ();
|
||||
fprintf (Gbl.F.Out,"</td>");
|
||||
}
|
||||
|
@ -1024,127 +1094,223 @@ void Mai_ShowFormChangeUsrEmail (void)
|
|||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
NumEmails ? Txt_New_email : // A new e-mail
|
||||
Txt_Email); // The first e-mail
|
||||
Act_FormStart (ActChgMai);
|
||||
if (ItsMe)
|
||||
Act_FormStart (ActNewMaiMe);
|
||||
else
|
||||
{
|
||||
Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActNewMaiStd :
|
||||
(UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ActNewMaiTch :
|
||||
ActNewMaiOth)); // Guest, visitor or admin
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<div class=\"FORM_ACCOUNT\">"
|
||||
"<input type=\"text\" name=\"NewEmail\""
|
||||
" size=\"20\" maxlength=\"%u\" value=\"%s\" />"
|
||||
"</div>",
|
||||
Usr_MAX_BYTES_USR_EMAIL,
|
||||
Gbl.Usrs.Me.UsrDat.Email);
|
||||
Lay_PutCreateButtonInline (NumEmails ? Txt_Change_email : // I already have an e-mail address
|
||||
Txt_Save); // I have no e-mail address yet);
|
||||
Lay_PutCreateButtonInline (NumEmails ? Txt_Change_email : // User already has an e-mail address
|
||||
Txt_Save); // User has no e-mail address yet
|
||||
Act_FormEnd ();
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
"</tr>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Remove e-mail address ****************************/
|
||||
/******************* Remove one of my user's e-mails *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Mai_RemoveEmail (void)
|
||||
void Mai_RemoveMyUsrEmail (void)
|
||||
{
|
||||
extern const char *Txt_Email_X_removed;
|
||||
extern const char *Txt_You_can_not_delete_your_current_email;
|
||||
char Email[Usr_MAX_BYTES_USR_EMAIL+1];
|
||||
/***** Remove user's e-mail *****/
|
||||
Mai_RemoveEmail (&Gbl.Usrs.Me.UsrDat);
|
||||
|
||||
/***** Get new e-mail from form *****/
|
||||
Par_GetParToText ("Email",Email,Usr_MAX_BYTES_USR_EMAIL);
|
||||
|
||||
if (strcasecmp (Email,Gbl.Usrs.Me.UsrDat.Email)) // Only if not my current e-mail
|
||||
{
|
||||
/***** Remove one of my old e-mail addresses *****/
|
||||
Mai_RemoveEmailFromDB (Email);
|
||||
|
||||
/***** Show message *****/
|
||||
sprintf (Gbl.Message,Txt_Email_X_removed,Email);
|
||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
}
|
||||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_delete_your_current_email);
|
||||
/***** Update list of e-mails *****/
|
||||
Mai_GetEmailFromUsrCod (&Gbl.Usrs.Me.UsrDat);
|
||||
|
||||
/***** Show my account again *****/
|
||||
Acc_ShowFormChangeMyAccount ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Remove one of the user's IDs of another user ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Mai_RemoveOtherUsrEmail (void)
|
||||
{
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
|
||||
/***** Get other user's code from form and get user's data *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
/***** Remove user's e-mail *****/
|
||||
Mai_RemoveEmail (&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
/***** Update list of e-mails *****/
|
||||
Mai_GetEmailFromUsrCod (&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
/***** Show user's record *****/
|
||||
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
||||
}
|
||||
else // User not found
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Remove e-mail address ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Mai_RemoveEmail (const struct UsrData *UsrDat)
|
||||
{
|
||||
extern const char *Txt_Email_X_removed;
|
||||
extern const char *Txt_You_can_not_delete_the_current_email;
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
char Email[Usr_MAX_BYTES_USR_EMAIL+1];
|
||||
|
||||
if (Pwd_CheckIfICanChangeOtherUsrPassword (UsrDat->UsrCod))
|
||||
{
|
||||
/***** Get new e-mail from form *****/
|
||||
Par_GetParToText ("Email",Email,Usr_MAX_BYTES_USR_EMAIL);
|
||||
|
||||
if (strcasecmp (Email,UsrDat->Email)) // Only if not user's current e-mail
|
||||
{
|
||||
/***** Remove one of user's old e-mail addresses *****/
|
||||
Mai_RemoveEmailFromDB (UsrDat->UsrCod,Email);
|
||||
|
||||
/***** Show message *****/
|
||||
sprintf (Gbl.Message,Txt_Email_X_removed,Email);
|
||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
}
|
||||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_delete_the_current_email);
|
||||
}
|
||||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Remove an old e-mail address from database ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Mai_RemoveEmailFromDB (const char *Email)
|
||||
static void Mai_RemoveEmailFromDB (long UsrCod,const char *Email)
|
||||
{
|
||||
char Query[1024];
|
||||
|
||||
/***** Remove an old e-mail address *****/
|
||||
sprintf (Query,"DELETE FROM usr_emails"
|
||||
" WHERE UsrCod='%ld' AND E_mail='%s'",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,Email);
|
||||
UsrCod,Email);
|
||||
DB_QueryREPLACE (Query,"can not remove an old e-mail address");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************* New user's e-mail for me **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void May_NewMyUsrEmail (void)
|
||||
{
|
||||
/***** Remove user's e-mail *****/
|
||||
Mai_NewUsrEmail (&Gbl.Usrs.Me.UsrDat,true); // It's me
|
||||
|
||||
/***** Update list of e-mails *****/
|
||||
Mai_GetEmailFromUsrCod (&Gbl.Usrs.Me.UsrDat);
|
||||
|
||||
/***** Show my account again *****/
|
||||
Acc_ShowFormChangeMyAccount ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** New user's e-mail for another user *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Mai_NewOtherUsrEmail (void)
|
||||
{
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
|
||||
/***** Get other user's code from form and get user's data *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
/***** New user's ID *****/
|
||||
Mai_NewUsrEmail (&Gbl.Usrs.Other.UsrDat,
|
||||
(Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me?
|
||||
|
||||
/***** Update list of e-mails *****/
|
||||
Mai_GetEmailFromUsrCod (&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
/***** Show user's record *****/
|
||||
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
|
||||
}
|
||||
else // User not found
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************* Update my e-mail address **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Mai_UpdateEmail (void)
|
||||
static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
|
||||
{
|
||||
extern const char *Txt_The_email_address_X_matches_the_one_you_had_previously_registered;
|
||||
extern const char *Txt_Your_email_address_X_has_been_registered_successfully;
|
||||
extern const char *Txt_The_email_address_X_matches_one_previously_registered;
|
||||
extern const char *Txt_The_email_address_X_has_been_registered_successfully;
|
||||
extern const char *Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address;
|
||||
extern const char *Txt_The_email_address_X_had_been_registered_by_another_user;
|
||||
extern const char *Txt_The_email_address_entered_X_is_not_valid;
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
char NewEmail[Usr_MAX_BYTES_USR_EMAIL+1];
|
||||
|
||||
/***** Get new e-mail from form *****/
|
||||
Par_GetParToText ("NewEmail",NewEmail,Usr_MAX_BYTES_USR_EMAIL);
|
||||
|
||||
if (Mai_CheckIfEmailIsValid (NewEmail)) // New e-mail is valid
|
||||
if (Pwd_CheckIfICanChangeOtherUsrPassword (UsrDat->UsrCod))
|
||||
{
|
||||
/***** Check if new e-mail exists in database *****/
|
||||
if (Gbl.Usrs.Me.UsrDat.EmailConfirmed &&
|
||||
!strcmp (Gbl.Usrs.Me.UsrDat.Email,NewEmail)) // My current confirmed email match exactly the new email
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_email_address_X_matches_the_one_you_had_previously_registered,
|
||||
NewEmail);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
}
|
||||
else
|
||||
/***** Get new e-mail from form *****/
|
||||
Par_GetParToText ("NewEmail",NewEmail,Usr_MAX_BYTES_USR_EMAIL);
|
||||
|
||||
if (Mai_CheckIfEmailIsValid (NewEmail)) // New e-mail is valid
|
||||
{
|
||||
if (Mai_UpdateEmailInDB (&Gbl.Usrs.Me.UsrDat,NewEmail))
|
||||
/***** Check if new e-mail exists in database *****/
|
||||
if (UsrDat->EmailConfirmed &&
|
||||
!strcmp (UsrDat->Email,NewEmail)) // User's current confirmed email match exactly the new email
|
||||
{
|
||||
/* E-mail updated sucessfully */
|
||||
strcpy (Gbl.Usrs.Me.UsrDat.Email,NewEmail);
|
||||
Gbl.Usrs.Me.UsrDat.EmailConfirmed = false;
|
||||
|
||||
sprintf (Gbl.Message,Txt_Your_email_address_X_has_been_registered_successfully,
|
||||
sprintf (Gbl.Message,Txt_The_email_address_X_matches_one_previously_registered,
|
||||
NewEmail);
|
||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
|
||||
/* Send message via email to confirm the new email address */
|
||||
if (Mai_SendMailMsgToConfirmEmail ())
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
|
||||
Gbl.Usrs.Me.UsrDat.Email);
|
||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_email_address_X_had_been_registered_by_another_user,
|
||||
NewEmail);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // New e-mail is not valid
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
|
||||
NewEmail);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Mai_UpdateEmailInDB (UsrDat,NewEmail))
|
||||
{
|
||||
/* E-mail updated sucessfully */
|
||||
strcpy (UsrDat->Email,NewEmail);
|
||||
UsrDat->EmailConfirmed = false;
|
||||
|
||||
/***** Show my account again *****/
|
||||
Acc_ShowFormChangeMyAccount ();
|
||||
sprintf (Gbl.Message,Txt_The_email_address_X_has_been_registered_successfully,
|
||||
NewEmail);
|
||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
|
||||
if (ItsMe)
|
||||
/* Send message via email to confirm the new email address */
|
||||
if (Mai_SendMailMsgToConfirmEmail ())
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
|
||||
Gbl.Usrs.Me.UsrDat.Email);
|
||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_email_address_X_had_been_registered_by_another_user,
|
||||
NewEmail);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // New e-mail is not valid
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
|
||||
NewEmail);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1153,7 +1319,7 @@ void Mai_UpdateEmail (void)
|
|||
// Return true if e-mail is successfully updated
|
||||
// Return false if e-mail can not be updated beacuse it is registered by another user
|
||||
|
||||
bool Mai_UpdateEmailInDB (struct UsrData *UsrDat,const char *NewEmail)
|
||||
bool Mai_UpdateEmailInDB (const struct UsrData *UsrDat,const char *NewEmail)
|
||||
{
|
||||
char Query[1024];
|
||||
|
||||
|
@ -1161,20 +1327,20 @@ bool Mai_UpdateEmailInDB (struct UsrData *UsrDat,const char *NewEmail)
|
|||
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
|
||||
" WHERE E_mail='%s' AND Confirmed='Y'"
|
||||
" AND UsrCod<>'%ld'",
|
||||
NewEmail,Gbl.Usrs.Me.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
|
||||
return false; // Don't update
|
||||
|
||||
/***** Delete e-mail (not confirmed) for other users *****/
|
||||
sprintf (Query,"DELETE FROM pending_emails"
|
||||
" WHERE E_mail='%s' AND UsrCod<>'%ld'",
|
||||
NewEmail,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
NewEmail,UsrDat->UsrCod);
|
||||
DB_QueryDELETE (Query,"can not remove pending e-mail for other users");
|
||||
|
||||
sprintf (Query,"DELETE FROM usr_emails"
|
||||
" WHERE E_mail='%s' AND Confirmed='N'"
|
||||
" AND UsrCod<>'%ld'",
|
||||
NewEmail,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
NewEmail,UsrDat->UsrCod);
|
||||
DB_QueryDELETE (Query,"can not remove not confirmed e-mail for other users");
|
||||
|
||||
/***** Update e-mail in database *****/
|
||||
|
|
15
swad_mail.h
15
swad_mail.h
|
@ -67,12 +67,17 @@ void Mai_RenameMailDomainFull (void);
|
|||
void Mai_RecFormNewMailDomain (void);
|
||||
|
||||
bool Mai_CheckIfEmailIsValid (const char *Email);
|
||||
bool Mai_GetEmailFromUsrCod (long UsrCod,char *Email,bool *Confirmed);
|
||||
bool Mai_GetEmailFromUsrCod (struct UsrData *UsrDat);
|
||||
long Mai_GetUsrCodFromEmail (const char *Email);
|
||||
void Mai_ShowFormChangeUsrEmail (void);
|
||||
void Mai_RemoveEmail (void);
|
||||
void Mai_UpdateEmail (void);
|
||||
bool Mai_UpdateEmailInDB (struct UsrData *UsrDat,const char *NewEmail);
|
||||
|
||||
void Mai_PutLinkToChangeOtherUsrEmail (void);
|
||||
void Mai_ShowFormOthEmail (void);
|
||||
void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe);
|
||||
void Mai_RemoveMyUsrEmail (void);
|
||||
void Mai_RemoveOtherUsrEmail (void);
|
||||
void May_NewMyUsrEmail (void);
|
||||
void Mai_NewOtherUsrEmail (void);
|
||||
bool Mai_UpdateEmailInDB (const struct UsrData *UsrDat,const char *NewEmail);
|
||||
bool Mai_SendMailMsgToConfirmEmail (void);
|
||||
void Mai_ConfirmEmail (void);
|
||||
|
||||
|
|
106
swad_text.c
106
swad_text.c
|
@ -4100,17 +4100,17 @@ const char *Txt_Change_email =
|
|||
|
||||
const char *Txt_Change_IDs =
|
||||
#if L==0
|
||||
"Canviar IDs (DNI/cèdulas)";
|
||||
"Canviar IDs";
|
||||
#elif L==1
|
||||
"Ausweis-Nr. ändern";
|
||||
#elif L==2
|
||||
"Change IDs";
|
||||
#elif L==3
|
||||
"Cambiar ID (DNI/cédulas)";
|
||||
"Cambiar ID";
|
||||
#elif L==4
|
||||
"Changer IDs";
|
||||
#elif L==5
|
||||
"Cambiar ID (DNI/cédulas)"; // Okoteve traducción
|
||||
"Cambiar ID"; // Okoteve traducción
|
||||
#elif L==6
|
||||
"Cambiare ID";
|
||||
#elif L==7
|
||||
|
@ -39618,6 +39618,36 @@ const char *Txt_The_email_address_X_had_been_registered_by_another_user = // War
|
|||
" had been registered by another user."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_The_email_address_X_has_been_registered_successfully = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==0
|
||||
"El correo <strong>%s</strong>"
|
||||
" se ha registrado correctamente."; // Necessita traduccio
|
||||
#elif L==1
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Need Übersetzung
|
||||
#elif L==2
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully.";
|
||||
#elif L==3
|
||||
"El correo <strong>%s</strong>"
|
||||
" se ha registrado correctamente.";
|
||||
#elif L==4
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Besoin de traduction
|
||||
#elif L==5
|
||||
"El correo <strong>%s</strong>"
|
||||
" se ha registrado correctamente."; // Okoteve traducción
|
||||
#elif L==6
|
||||
"Il e-mail <strong>%s</strong>"
|
||||
" è stato registrato con successo.";
|
||||
#elif L==7
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Potrzebujesz tlumaczenie
|
||||
#elif L==8
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_The_email_address_has_not_been_confirmed =
|
||||
#if L==0
|
||||
"La dirección de correo"
|
||||
|
@ -39642,34 +39672,34 @@ const char *Txt_The_email_address_has_not_been_confirmed =
|
|||
"The email address has not been confirmed."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_The_email_address_X_matches_the_one_you_had_previously_registered = // Warning: it is very important to include %s in the following sentences
|
||||
const char *Txt_The_email_address_X_matches_one_previously_registered = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==0
|
||||
"La dirección de correo <strong>%s</strong>"
|
||||
" coincide con la que ya tenía registrada previamente."; // Necessita traduccio
|
||||
" coincide con una registrada previamente."; // Necessita traduccio
|
||||
#elif L==1
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" matches the one you had previously registered."; // Need Übersetzung
|
||||
" matches one previously registered."; // Need Übersetzung
|
||||
#elif L==2
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" matches the one you had previously registered.";
|
||||
" matches one previously registered.";
|
||||
#elif L==3
|
||||
"La dirección de correo <strong>%s</strong>"
|
||||
" coincide con la que ya tenía registrada previamente.";
|
||||
" coincide con una registrada previamente.";
|
||||
#elif L==4
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" matches the one you had previously registered."; // Besoin de traduction
|
||||
" matches one previously registered."; // Besoin de traduction
|
||||
#elif L==5
|
||||
"La dirección de correo <strong>%s</strong>"
|
||||
" coincide con la que ya tenía registrada previamente."; // Okoteve traducción
|
||||
" coincide con una registrada previamente."; // Okoteve traducción
|
||||
#elif L==6
|
||||
"Il e-mail <strong>%s</strong>"
|
||||
" coincide con quellao che hai precedentemente registrato.";
|
||||
" coincide con uno precedentemente registrato.";
|
||||
#elif L==7
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" matches the one you had previously registered."; // Potrzebujesz tlumaczenie
|
||||
" matches one previously registered."; // Potrzebujesz tlumaczenie
|
||||
#elif L==8
|
||||
"The e-mail address <strong>%s</strong>"
|
||||
" matches the one you had previously registered."; // Necessita de tradução
|
||||
" matches one previously registered."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_The_enrollment_of_students_into_groups_of_type_X_is_now_mandatory = // Warning: it is very important to include %s in the following sentences
|
||||
|
@ -49131,25 +49161,25 @@ const char *Txt_You_can_not_create_links_here =
|
|||
"You can not create links here."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_You_can_not_delete_your_current_email =
|
||||
const char *Txt_You_can_not_delete_the_current_email =
|
||||
#if L==0
|
||||
"No puede eliminar su correo actual."; // Necessita traduccio
|
||||
"No puede eliminar el correo actual."; // Necessita traduccio
|
||||
#elif L==1
|
||||
"You can not delete your current e-mail."; // Need Übersetzung
|
||||
"You can not delete the current e-mail."; // Need Übersetzung
|
||||
#elif L==2
|
||||
"You can not delete your current e-mail.";
|
||||
"You can not delete the current e-mail.";
|
||||
#elif L==3
|
||||
"No puede eliminar su correo actual.";
|
||||
"No puede eliminar el correo actual.";
|
||||
#elif L==4
|
||||
"You can not delete your current e-mail."; // Besoin de traduction
|
||||
"You can not delete the current e-mail."; // Besoin de traduction
|
||||
#elif L==5
|
||||
"No puede eliminar su correo actual."; // Okoteve traducción
|
||||
"No puede eliminar el correo actual."; // Okoteve traducción
|
||||
#elif L==6
|
||||
"Non puoi cancellare il tuo e-mail attuale.";
|
||||
"Non puoi cancellare il e-mail attuale.";
|
||||
#elif L==7
|
||||
"You can not delete your current e-mail."; // Potrzebujesz tlumaczenie
|
||||
"You can not delete the current e-mail."; // Potrzebujesz tlumaczenie
|
||||
#elif L==8
|
||||
"You can not delete your current e-mail."; // Necessita de tradução
|
||||
"You can not delete the current e-mail."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_You_can_not_delete_your_current_nickname =
|
||||
|
@ -51949,36 +51979,6 @@ const char *Txt_Your_comment_has_been_updated =
|
|||
"O seu comentário foi atualizado.";
|
||||
#endif
|
||||
|
||||
const char *Txt_Your_email_address_X_has_been_registered_successfully = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==0
|
||||
"Su correo <strong>%s</strong>"
|
||||
" se ha registrado correctamente."; // Necessita traduccio
|
||||
#elif L==1
|
||||
"Your e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Need Übersetzung
|
||||
#elif L==2
|
||||
"Your e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully.";
|
||||
#elif L==3
|
||||
"Su correo <strong>%s</strong>"
|
||||
" se ha registrado correctamente.";
|
||||
#elif L==4
|
||||
"Your e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Besoin de traduction
|
||||
#elif L==5
|
||||
"Su correo <strong>%s</strong>"
|
||||
" se ha registrado correctamente."; // Okoteve traducción
|
||||
#elif L==6
|
||||
"Il tuo e-mail <strong>%s</strong>"
|
||||
" è stato registrato con successo.";
|
||||
#elif L==7
|
||||
"Your e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Potrzebujesz tlumaczenie
|
||||
#elif L==8
|
||||
"Your e-mail address <strong>%s</strong>"
|
||||
" has been registered successfully."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_Your_language_has_changed_to_LANGUAGE =
|
||||
#if L==0
|
||||
"El seu idioma ha canviat a català.";
|
||||
|
|
|
@ -559,7 +559,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
|
|||
Nck_GetNicknameFromUsrCod (UsrDat->UsrCod,UsrDat->Nickname);
|
||||
|
||||
/***** Get e-mail *****/
|
||||
Mai_GetEmailFromUsrCod (UsrDat->UsrCod,UsrDat->Email,&(UsrDat->EmailConfirmed));
|
||||
Mai_GetEmailFromUsrCod (UsrDat);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue