Version 16.21

This commit is contained in:
Antonio Cañas Vargas 2016-10-12 14:02:56 +02:00
parent e9e03c1918
commit 31d41db036
20 changed files with 155 additions and 106 deletions

View File

@ -480,7 +480,7 @@ void ID_PutLinkToChangeUsrIDs (void)
/***** Link for changing the password *****/
if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me
Lay_PutContextualLink (ActFrmUsrAcc,NULL,
Lay_PutContextualLink (ActFrmMyAcc,NULL,
"arroba64x64.gif",
Txt_Change_IDs,Txt_Change_IDs,
NULL);

View File

@ -97,7 +97,7 @@ void Acc_PutLinkToCreateAccount (void)
{
extern const char *Txt_Create_account;
Lay_PutContextualLink (ActFrmUsrAcc,NULL,
Lay_PutContextualLink (ActFrmMyAcc,NULL,
"arroba64x64.gif",
Txt_Create_account,Txt_Create_account,
NULL);
@ -107,7 +107,7 @@ void Acc_PutLinkToCreateAccount (void)
/******** Show form to change my account or to create a new account **********/
/*****************************************************************************/
void Acc_ShowFormAccount (void)
void Acc_ShowFormMyAccount (void)
{
extern const char *Txt_Before_creating_a_new_account_check_if_you_have_been_already_registered_with_your_ID;
@ -394,7 +394,7 @@ void Acc_ShowFormGoToRequestNewAccount (void)
Lay_StartRoundFrame (NULL,Gbl.Title,NULL);
/***** Button to go to request the creation of a new account *****/
Act_FormStart (ActFrmUsrAcc);
Act_FormStart (ActFrmMyAcc);
Lay_PutCreateButton (Txt_Create_a_new_account);
Act_FormEnd ();

View File

@ -51,7 +51,7 @@ typedef enum
/*****************************************************************************/
void Acc_PutLinkToCreateAccount (void);
void Acc_ShowFormAccount (void);
void Acc_ShowFormMyAccount (void);
void Acc_CheckIfEmptyAccountExists (void);

View File

@ -1315,7 +1315,7 @@ Profile:
1128. ActMyCrs Select one of my courses
1129. ActSeeMyTT Show the timetable of all courses of the logged user
NEW. ActSeeMyAgd Show my agenda (personal organizer)
1130. ActFrmUsrAcc Show form to the creation or change of user's account
1130. ActFrmMyAcc Show form to the creation or change of user's account
1131. ActReqEdiRecCom Request the edition of the record with the personal data of the user
1132. ActEdiPrf Show forms to edit preferences
1133. ActAdmBrf Show the briefcase of private archives
@ -2744,7 +2744,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActMyCrs */{ 987, 2,TabPrf,ActMyCrs ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Crs_ReqSelectOneOfMyCourses ,"mygroups64x64.gif" },
/* ActSeeMyTT */{ 408, 3,TabPrf,ActSeeMyTT ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,TT_ShowClassTimeTable ,"clock64x64.gif" },
/* ActSeeMyAgd */{1581, 4,TabPrf,ActSeeMyAgd ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Agd_ShowMyAgenda ,"date64x64.gif" },
/* ActFrmUsrAcc */{ 36, 5,TabPrf,ActFrmUsrAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_ShowFormAccount ,"arroba64x64.gif" },
/* ActFrmMyAcc */{ 36, 5,TabPrf,ActFrmMyAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_ShowFormMyAccount ,"arroba64x64.gif" },
/* ActReqEdiRecCom */{ 285, 6,TabPrf,ActReqEdiRecCom ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rec_ShowFormMyCommRecord ,"card64x64.gif" },
/* ActEdiPrf */{ 673, 7,TabPrf,ActEdiPrf ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Pre_EditPrefs ,"heart64x64.gif" },
/* ActAdmBrf */{ 23, 8,TabPrf,ActAdmBrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Brw_ShowFileBrowserOrWorks ,"pendrive64x64.gif" },
@ -2761,24 +2761,24 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActAnnSee */{1234,-1,TabPrf,ActFrmRolSes ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ann_MarkAnnouncementAsSeen ,NULL},
/* ActChgMyRol */{ 589,-1,TabPrf,ActFrmRolSes ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Rol_ChangeMyRole ,Usr_ShowFormsLogoutAndRole ,NULL},
/* ActChkUsrAcc */{1584,-1,TabPrf,ActFrmUsrAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_CheckIfEmptyAccountExists ,NULL},
/* ActCreUsrAcc */{1163,-1,TabPrf,ActFrmUsrAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_AfterCreationNewAccount ,NULL},
/* ActChkUsrAcc */{1584,-1,TabPrf,ActFrmMyAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_CheckIfEmptyAccountExists ,NULL},
/* ActCreUsrAcc */{1163,-1,TabPrf,ActFrmMyAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_AfterCreationNewAccount ,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},
/* ActRemID_Me */{1147,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,ID_RemoveMyUsrID ,NULL},
/* ActNewIDMe */{1148,-1,TabPrf,ActFrmMyAcc ,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},
/* ActRemOldNic */{1089,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Nck_RemoveNick ,NULL},
/* ActChgNic */{ 37,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Nck_UpdateNick ,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},
/* ActRemMaiMe */{1090,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Mai_RemoveMyUsrEmail ,NULL},
/* ActNewMaiMe */{1088,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,May_NewMyUsrEmail ,NULL},
/* ActCnfMai */{1091,-1,TabPrf,ActFrmMyAcc ,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},
/* ActChgPwd */{ 35,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Pwd_ActChgMyPwd1 ,Pwd_ActChgMyPwd2 ,NULL},
/* ActFrmChgMyPwd */{ 34,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Pwd_ShowFormChgPwd ,NULL},
/* ActChgPwd */{ 35,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Pwd_ActChgMyPwd1 ,Pwd_ActChgMyPwd2 ,NULL},
/* ActReqRemMyAcc */{1430,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_AskIfRemoveMyAccount ,NULL},
/* ActRemMyAcc */{1431,-1,TabPrf,ActFrmUsrAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_RemoveMyAccount ,NULL},
/* ActReqRemMyAcc */{1430,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_AskIfRemoveMyAccount ,NULL},
/* ActRemMyAcc */{1431,-1,TabPrf,ActFrmMyAcc ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Acc_RemoveMyAccount ,NULL},
/* ActChgMyData */{ 298,-1,TabPrf,ActReqEdiRecCom ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Rec_UpdateMyRecord ,Rec_ShowMyCommonRecordUpd ,NULL},
@ -2816,7 +2816,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActChgMnu */{1243,-1,TabPrf,ActEdiPrf ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,Mnu_ChangeMenu ,Pre_EditPrefs ,NULL},
/* ActChgNtfPrf */{ 775,-1,TabPrf,ActEdiPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ntf_ChangeNotifyEvents ,Pre_EditPrefs ,NULL},
/* ActPrnUsrQR */{1022,-1,TabPrf,ActFrmUsrAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,QR_PrintQRCode ,NULL},
/* ActPrnUsrQR */{1022,-1,TabPrf,ActFrmMyAcc ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,QR_PrintQRCode ,NULL},
/* ActPrnMyTT */{ 409,-1,TabPrf,ActSeeMyTT ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,TT_ShowClassTimeTable ,NULL},
/* ActEdiTut */{ 65,-1,TabPrf,ActSeeMyTT ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,TT_ShowMyTutTimeTable ,NULL},
@ -2883,7 +2883,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
-1, // #33 (obsolete action)
ActFrmChgMyPwd, // #34
ActChgPwd, // #35
ActFrmUsrAcc, // #36
ActFrmMyAcc, // #36
ActChgNic, // #37
-1, // #38 (obsolete action)
-1, // #39 (obsolete action)
@ -4495,7 +4495,7 @@ void Act_GetBreadcrumbStrForAction (Act_Action_t Action,bool HTML,char *Breadcru
extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS];
extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
Act_Action_t Superaction = Act_Actions[Action].SuperAction;
Act_Tab_t Tab = Act_Actions[Superaction].Tab;
Tab_Tab_t Tab = Act_Actions[Superaction].Tab;
char *Arrow;
Arrow = HTML ? ">" :
@ -4837,7 +4837,7 @@ void Act_AdjustCurrentAction (void)
case ActFrmChgMyPwd:
break;
default:
Gbl.Action.Act = ActFrmUsrAcc;
Gbl.Action.Act = ActFrmMyAcc;
Tab_SetCurrentTab ();
return;
}
@ -4852,7 +4852,7 @@ void Act_AdjustCurrentAction (void)
switch (Gbl.Action.Act)
{
case ActHom: case ActLogOut:
case ActFrmUsrAcc: case ActFrmChgMyPwd:
case ActFrmMyAcc: case ActFrmChgMyPwd:
break;
default:
Gbl.Action.Act = ActReqEdiRecCom;
@ -4869,7 +4869,7 @@ void Act_AdjustCurrentAction (void)
switch (Gbl.Action.Act)
{
case ActHom: case ActLogOut:
case ActFrmUsrAcc: case ActFrmChgMyPwd:
case ActFrmMyAcc: case ActFrmChgMyPwd:
case ActReqEdiRecCom:
break;
default:
@ -4884,7 +4884,7 @@ void Act_AdjustCurrentAction (void)
switch (Gbl.Action.Act)
{
case ActHom: case ActLogOut:
case ActFrmUsrAcc: case ActFrmChgMyPwd:
case ActFrmMyAcc: case ActFrmChgMyPwd:
case ActReqEdiRecCom: case ActReqEdiMyIns:
break;
default:
@ -4917,7 +4917,7 @@ void Act_AdjustCurrentAction (void)
case ActHom:
case ActMnu:
case ActLogOut:
case ActFrmUsrAcc:
case ActFrmMyAcc:
case ActFrmChgMyPwd:
case ActReqEdiRecCom:
case ActReqEdiMyIns:

View File

@ -30,6 +30,7 @@
#include <stdbool.h> // For boolean type
#include "swad_cryptography.h"
#include "swad_tab.h"
#include "swad_text.h"
/*****************************************************************************/
@ -38,24 +39,6 @@
#define Act_MAX_LENGTH_ACTION_TXT 255
// Related with tabs and actions
typedef enum
{
TabUnk = 0,
TabSys = 1,
TabCty = 2,
TabIns = 3,
TabCtr = 4,
TabDeg = 5,
TabCrs = 6,
TabAss = 7,
TabUsr = 8,
TabSoc = 9,
TabMsg = 10,
TabSta = 11,
TabPrf = 12,
} Act_Tab_t;
typedef enum
{
Act_CONTENT_NORM,
@ -1372,7 +1355,7 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
#define ActMyCrs (ActSeeMyUsgRep+ 3)
#define ActSeeMyTT (ActSeeMyUsgRep+ 4)
#define ActSeeMyAgd (ActSeeMyUsgRep+ 5)
#define ActFrmUsrAcc (ActSeeMyUsgRep+ 6)
#define ActFrmMyAcc (ActSeeMyUsgRep+ 6)
#define ActReqEdiRecCom (ActSeeMyUsgRep+ 7)
#define ActEdiPrf (ActSeeMyUsgRep+ 8)
#define ActAdmBrf (ActSeeMyUsgRep+ 9)
@ -1478,7 +1461,7 @@ struct Act_Actions
{
long ActCod; // Unique, time-persistent numerical code for the action
signed int IndexInMenu;
Act_Tab_t Tab;
Tab_Tab_t Tab;
Act_Action_t SuperAction;
unsigned PermisIfIBelongToCrs;
unsigned PermisIfIDontBelongToCrs;

View File

@ -148,13 +148,15 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.20 (2016-10-11)"
#define Log_PLATFORM_VERSION "SWAD 16.21 (2016-10-12)"
#define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
Version 16.21: Oct 12, 2016 Code refactoring related with warning about e-mail notifications.
Notification mail is sent only if e-mail is confirmed. (205278 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.2: Oct 11, 2016 Code optimization in file browser. (205198 lines)

View File

@ -168,7 +168,7 @@ struct Globals
bool YearOK;
struct
{
Act_Tab_t Tab;
Tab_Tab_t Tab;
Act_Action_t Act;
bool UsesAJAX;
} Action;

View File

@ -231,7 +231,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
sprintf (Gbl.Title,Txt_New_on_PLATFORM_Sign_up,
Cfg_PLATFORM_SHORT_NAME);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActFrmUsrAcc,
ActFrmMyAcc,
"BT_CREATE",Txt_Create_account);
}

View File

@ -37,6 +37,7 @@
#include "swad_mail.h"
#include "swad_parameter.h"
#include "swad_QR.h"
#include "swad_tab.h"
#include "swad_text.h"
/*****************************************************************************/
@ -66,6 +67,8 @@ extern struct Globals Gbl;
static void Mai_GetParamMaiOrderType (void);
static void Mai_PutIconToEditMailDomains (void);
static void Mai_GetListMailDomainsAllowedForNotif (void);
static bool Mai_CheckIfMailDomainIsAllowedForNotif (const char *MailDomain);
static void Mai_ListMailDomainsForEdition (void);
static void Mai_PutParamMaiCod (long MaiCod);
static void Mai_RenameMailDomain (Cns_ShortOrFullName_t ShortOrFullName);
@ -307,11 +310,28 @@ static void Mai_GetListMailDomainsAllowedForNotif (void)
DB_ExitOnMySQLError ("can not remove temporary tables");
}
/*****************************************************************************/
/************ Check if user can receive notifications via e-mail *************/
/*****************************************************************************/
bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct UsrData *UsrDat)
{
char MailDomain[Usr_MAX_BYTES_USR_EMAIL+1];
/***** Check #1: is my e-mail address confirmed? *****/
if (!UsrDat->EmailConfirmed)
return false;
/***** Check #2: if my mail domain allowed? *****/
Str_GetMailBox (UsrDat->Email,MailDomain,Usr_MAX_BYTES_USR_EMAIL);
return Mai_CheckIfMailDomainIsAllowedForNotif (MailDomain);
}
/*****************************************************************************/
/************ Check if a mail domain is allowed for notifications ************/
/*****************************************************************************/
bool Mai_CheckIfMailDomainIsAllowedForNotifications (const char *MailDomain)
static bool Mai_CheckIfMailDomainIsAllowedForNotif (const char *MailDomain)
{
char Query[512];
@ -321,6 +341,29 @@ bool Mai_CheckIfMailDomainIsAllowedForNotifications (const char *MailDomain)
return (DB_QueryCOUNT (Query,"can not check if a mail domain is allowed for notifications") != 0);
}
/*****************************************************************************/
/***************** Show warning about notifications via e-mail ***************/
/*****************************************************************************/
void Mai_WriteWarningEmailNotifications (void)
{
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_You_can_only_receive_email_notifications_if_;
extern const char *Txt_TABS_SHORT_TXT[Tab_NUM_TABS];
extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
Act_Action_t SuperActionMyAccount = Act_Actions[ActFrmMyAcc].SuperAction;
Act_Action_t SuperActionMailDomains = Act_Actions[ActSeeMai ].SuperAction;
Tab_Tab_t TabMyAccount = Act_Actions[SuperActionMyAccount ].Tab;
Tab_Tab_t TabMailDomains = Act_Actions[SuperActionMailDomains].Tab;
sprintf (Gbl.Message,Txt_You_can_only_receive_email_notifications_if_,
Txt_TABS_SHORT_TXT[TabMyAccount ],
Txt_MENU_TITLE[TabMyAccount ][Act_Actions[SuperActionMyAccount ].IndexInMenu],
Txt_TABS_SHORT_TXT[TabMailDomains],
Txt_MENU_TITLE[TabMailDomains][Act_Actions[SuperActionMailDomains].IndexInMenu]);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
}
/*****************************************************************************/
/**************************** Get mail domain data ***************************/
/*****************************************************************************/
@ -1050,7 +1093,7 @@ void Mai_PutLinkToChangeOtherUsrEmail (void)
/***** Link for changing the password *****/
if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me
Lay_PutContextualLink (ActFrmUsrAcc,NULL,
Lay_PutContextualLink (ActFrmMyAcc,NULL,
"msg64x64.gif",
Txt_Change_email,Txt_Change_email,
NULL);
@ -1478,7 +1521,7 @@ void Mai_PutButtonToCheckEmailAddress (void)
extern const char *Txt_Check;
/***** Start form *****/
Act_FormStart (ActFrmUsrAcc);
Act_FormStart (ActFrmMyAcc);
/***** Frame with button to go to account *****/
Lay_StartRoundFrame (NULL,Txt_Email_unconfirmed,NULL);

View File

@ -58,7 +58,10 @@ struct Mail
void Mai_SeeMailDomains (void);
void Mai_EditMailDomains (void);
void Mai_FreeListMailDomains (void);
bool Mai_CheckIfMailDomainIsAllowedForNotifications (const char *MailDomain);
bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct UsrData *UsrDat);
void Mai_WriteWarningEmailNotifications (void);
void Mai_GetDataOfMailDomainByCod (struct Mail *Plc);
long Mai_GetParamMaiCod (void);
void Mai_RemoveMailDomain (void);

View File

@ -186,7 +186,7 @@ const Act_Action_t Mnu_MenuActions[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB
ActMyCrs,
ActSeeMyTT,
ActSeeMyAgd,
ActFrmUsrAcc,
ActFrmMyAcc,
ActReqEdiRecCom,
ActEdiPrf,
ActAdmBrf,

View File

@ -1527,7 +1527,6 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
extern const char *Txt_TAB_Messages_NO_HTML[1+Txt_NUM_LANGUAGES];
extern const char *Txt_Notifications_NO_HTML[1+Txt_NUM_LANGUAGES];
extern const char *Txt_If_you_no_longer_wish_to_receive_email_notifications_NO_HTML[1+Txt_NUM_LANGUAGES];
char MailDomain[Usr_MAX_BYTES_USR_EMAIL+1];
char Query[512];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1549,8 +1548,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
/***** Return 0 notifications and 0 mails when error *****/
*NumNotif = *NumMails = 0;
Str_GetMailBox (ToUsrDat->Email,MailDomain,Usr_MAX_BYTES_USR_EMAIL);
if (Mai_CheckIfMailDomainIsAllowedForNotifications (MailDomain))
if (Mai_CheckIfUsrCanReceiveEmailNotif (ToUsrDat))
{
/***** Get pending notifications of this user from database ******/
sprintf (Query,"SELECT NotifyEvent,FromUsrCod,InsCod,CtrCod,DegCod,CrsCod,Cod"
@ -1620,7 +1618,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
/* Get forum type */
if (NotifyEvent == Ntf_EVENT_FORUM_POST_COURSE ||
NotifyEvent == Ntf_EVENT_FORUM_REPLY)
NotifyEvent == Ntf_EVENT_FORUM_REPLY)
ForumType = For_GetForumTypeOfAPost (Cod);
/* Information about the type of this event */
@ -1699,7 +1697,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
Cfg_AUTOMATIC_EMAIL_SMTP_SERVER,
Cfg_AUTOMATIC_EMAIL_SMTP_PORT,
Cfg_AUTOMATIC_EMAIL_FROM,
Gbl.Config.SMTPPassword,
Gbl.Config.SMTPPassword,
ToUsrDat->Email,
Cfg_PLATFORM_SHORT_NAME,
Txt_Notifications_NO_HTML[ToUsrLanguage],
@ -1724,7 +1722,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
/***** Mark all the pending notifications of this user as 'sent' *****/
sprintf (Query,"UPDATE notif SET Status=(Status | %u)"
" WHERE ToUsrCod='%ld'"
" WHERE ToUsrCod='%ld'"
" AND (Status & %u)<>0 AND (Status & %u)=0 AND (Status & %u)=0",
(unsigned) Ntf_STATUS_BIT_SENT,ToUsrDat->UsrCod,
(unsigned) Ntf_STATUS_BIT_EMAIL,
@ -1862,8 +1860,15 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
Act_FormStart (ActChgNtfPrf);
/***** Start frame *****/
Lay_StartRoundFrameTable (NULL,2,Txt_Notifications);
fprintf (Gbl.F.Out,"<tr>"
Lay_StartRoundFrame (NULL,Txt_Notifications,NULL);
/***** Warning if I can not receive e-mail notifications *****/
if (!Mai_CheckIfUsrCanReceiveEmailNotif (&Gbl.Usrs.Me.UsrDat))
Mai_WriteWarningEmailNotifications ();
/***** List of notifications *****/
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">"
"<tr>"
"<th></th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
@ -1903,8 +1908,10 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
"</tr>");
}
fprintf (Gbl.F.Out,"</table>");
/***** Button to save changes and end frame *****/
Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Save_changes);
Lay_EndRoundFrameWithButton (Lay_CONFIRM_BUTTON,Txt_Save_changes);
/***** End form *****/
Act_FormEnd ();

View File

@ -848,7 +848,7 @@ void Par_GetMainParameters (void)
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
if (UnsignedNum < Tab_NUM_TABS)
{
Gbl.Action.Tab = (Act_Tab_t) UnsignedNum;
Gbl.Action.Tab = (Tab_Tab_t) UnsignedNum;
Tab_DisableIncompatibleTabs ();
}
}

View File

@ -65,8 +65,6 @@ static void Pre_UpdateSideColsOnUsrDataTable (void);
void Pre_EditPrefs (void)
{
extern const char *Txt_Language;
extern const char *Txt_You_can_only_receive_email_notifications_if_;
char MailDomain[Usr_MAX_BYTES_USR_EMAIL+1];
/***** Language, first day of week *****/
fprintf (Gbl.F.Out,"<table style=\"margin:0 auto; border-spacing:16px 0;\">"
@ -115,10 +113,6 @@ void Pre_EditPrefs (void)
/***** Automatic e-mail to notify of new events *****/
Ntf_PutFormChangeNotifSentByEMail ();
Str_GetMailBox (Gbl.Usrs.Me.UsrDat.Email,MailDomain,Usr_MAX_BYTES_USR_EMAIL);
if (!Mai_CheckIfMailDomainIsAllowedForNotifications (MailDomain))
Lay_ShowAlert (Lay_WARNING,Txt_You_can_only_receive_email_notifications_if_);
}
}

View File

@ -763,7 +763,7 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report)
unsigned long NumRow;
long ActCod;
Act_Action_t Action;
Act_Tab_t Tab;
Tab_Tab_t Tab;
char ActTxt[Act_MAX_LENGTH_ACTION_TXT+1];
unsigned long NumClicks;

View File

@ -68,7 +68,7 @@ const char *Tab_TabIcons[Tab_NUM_TABS] =
/***************************** Private prototypes ****************************/
/*****************************************************************************/
static bool Tab_CheckIfICanViewTab (Act_Tab_t Tab);
static bool Tab_CheckIfICanViewTab (Tab_Tab_t Tab);
static void Tab_WriteBreadcrumbHome (void);
static void Tab_WriteBreadcrumbTab (void);
@ -86,7 +86,7 @@ void Tab_DrawTabs (void)
extern const char *The_TabOffBgColors[The_NUM_THEMES];
extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS];
extern const char *Txt_TABS_SHORT_TXT[Tab_NUM_TABS];
Act_Tab_t NumTab;
Tab_Tab_t NumTab;
bool ICanViewTab;
/***** Table start *****/
@ -94,8 +94,8 @@ void Tab_DrawTabs (void)
"<ul class=\"LIST_CENTER\">");
/***** Draw the tabs *****/
for (NumTab = (Act_Tab_t) 1;
NumTab <= (Act_Tab_t) Tab_NUM_TABS - 1;
for (NumTab = (Tab_Tab_t) 1;
NumTab <= (Tab_Tab_t) Tab_NUM_TABS - 1;
NumTab++)
{
ICanViewTab = Tab_CheckIfICanViewTab (NumTab);
@ -167,7 +167,7 @@ void Tab_DrawTabs (void)
/************************* Check if I can view a tab *************************/
/*****************************************************************************/
static bool Tab_CheckIfICanViewTab (Act_Tab_t Tab)
static bool Tab_CheckIfICanViewTab (Tab_Tab_t Tab)
{
switch (Tab)
{

View File

@ -37,6 +37,23 @@
/******************************* Public types ********************************/
/*****************************************************************************/
typedef enum
{
TabUnk = 0,
TabSys = 1,
TabCty = 2,
TabIns = 3,
TabCtr = 4,
TabDeg = 5,
TabCrs = 6,
TabAss = 7,
TabUsr = 8,
TabSoc = 9,
TabMsg = 10,
TabSta = 11,
TabPrf = 12,
} Tab_Tab_t;
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/

View File

@ -19260,7 +19260,7 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Agenda"
#endif
,
// ActFrmUsrAcc
// ActFrmMyAcc
#if L==1
"Compte"
#elif L==2
@ -21133,7 +21133,7 @@ const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Agenda"
#endif
,
// ActFrmUsrAcc
// ActFrmMyAcc
#if L==1
"Creaci&oacute; o edici&oacute; del meu compte d'usuari"
#elif L==2
@ -52632,43 +52632,43 @@ const char *Txt_You_can_only_perform_X_further_actions_ = // Warning: it is very
" if you don't send your photo."; // Necessita de tradução
#endif
const char *Txt_You_can_only_receive_email_notifications_if_ =
const char *Txt_You_can_only_receive_email_notifications_if_ = // Warning: it is very important to include four %s in the following sentences
#if L==1
"Solo podr&aacute; recibir notificaciones por correo"
" si su direcci&oacute;n de correo termina en uno de los dominios"
" listados en PLATAFORMA &gt; Dominios."; // Necessita traduccio
"Nom&eacute;s podr&agrave; rebre notificacions per correu"
" si la seva adre&ccedil;a de correu est&agrave; confirmada (%s &gt; %s)"
" i acaba en un dels dominis permesos (%s &gt; %s).";
#elif L==2
"You can only receive email notifications"
" if your email ends in one of the domains"
" listed in SYSTEM &gt; Domains."; // Need Übersetzung
"Sie k&ouml;nnen nur E-Mail-Anmeldungen zu erhalten,"
" wenn Sie Ihre E-Mail-Adresse best&uuml;tigt wird (%s &gt; %s),"
" und endet in einer der erlaubt Domains (%s &gt; %s).";
#elif L==3
"You can only receive email notifications"
" if your email ends in one of the domains"
" listed in SYSTEM &gt; Domains.";
" if your email address is confirmed (%s &gt; %s)"
" and ends in one of the allowed domains (%s &gt; %s).";
#elif L==4
"Solo podr&aacute; recibir notificaciones por correo"
" si su direcci&oacute;n de correo termina en uno de los dominios"
" listados en PLATAFORMA &gt; Dominios.";
" si su direcci&oacute;n de correo est&aacute; confirmada (%s &gt; %s)"
" y termina en uno de los dominios permitidos (%s &gt; %s).";
#elif L==5
"You can only receive email notifications"
" if your email ends in one of the domains"
" listed in SYSTEM &gt; Domains."; // Besoin de traduction
"Vous ne pouvez recevoir des notifications par email"
" si votre adresse e-mail est confirm&eacute; (%s &gt; %s)"
" et se termine dans l'un des domaines autoris&eacute;s (%s &gt; %s).";
#elif L==6
"Solo podr&aacute; recibir notificaciones por correo"
" si su direcci&oacute;n de correo termina en uno de los dominios"
" listados en PLATAFORMA &gt; Dominios."; // Okoteve traducción
" si su direcci&oacute;n de correo est&aacute; confirmada (%s &gt; %s)"
" y termina en uno de los dominios permitidos (%s &gt; %s)."; // Okoteve traducción
#elif L==7
"Puoi solo ricevere e-mail di notifica"
" se la tua e-mail termina in uno dei campi"
" listati in PIATTAFORMA &gt; Campi.";
" se la tua e-mail &egrave; confermata (%s &gt; %s)"
" e si termina in uno dei domini consentiti (%s &gt; %s).";
#elif L==8
"You can only receive email notifications"
" if your email ends in one of the domains"
" listed in SYSTEM &gt; Domains."; // Potrzebujesz tlumaczenie
"Mo&zdot;na otrzyma&cacute; tylko informacj&eogon;,"
" czy adres e-mail jest potwierdzone (%s &gt; %s),"
" a ko&nacute;czy si&eogon; w jednej z dozwolone domeny (%s &gt; %s).";
#elif L==9
"You can only receive email notifications"
" if your email ends in one of the domains"
" listed in SYSTEM &gt; Domains."; // Necessita de tradução
"Voc&ecirc; s&oacute; pode receber notifica&ccedil;&otilde;es de e-mail"
" se o seu endere&ccedil;o de e-mail est&aacute; confirmado (%s &gt; %s)"
" e termina em um dos dom&iacute;nios permitidos (%s &gt; %s).";
#endif
const char *Txt_You_can_register_voluntarily_in_one_group_of_type_X = // Warning: it is very important to include %s in the following sentences

View File

@ -673,7 +673,7 @@ static void Usr_GetMyLastData (void)
if (sscanf (row[2],"%u",&UnsignedNum) == 1)
if (UnsignedNum >= 1 ||
UnsignedNum <= Tab_NUM_TABS)
Gbl.Usrs.Me.UsrLast.LastTab = (Act_Tab_t) UnsignedNum;
Gbl.Usrs.Me.UsrLast.LastTab = (Tab_Tab_t) UnsignedNum;
/* Get last access to notifications */
Gbl.Usrs.Me.UsrLast.LastAccNotif = 0L;

View File

@ -169,7 +169,7 @@ struct UsrLast
{
Sch_WhatToSearch_t WhatToSearch; // Search courses, teachers, documents...?
long LastCrs;
Act_Tab_t LastTab;
Tab_Tab_t LastTab;
long LastAccNotif;
};