mirror of https://github.com/acanas/swad-core.git
Version18.92.2
This commit is contained in:
parent
ddf9c74d4b
commit
8873e4d2eb
|
@ -1610,13 +1610,13 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
||||||
/* ActRefOldSocPubUsr*/{1511,-1,TabUnk,ActRefOldSocPubUsr ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RefreshOldTimelineUsr ,NULL},
|
/* ActRefOldSocPubUsr*/{1511,-1,TabUnk,ActRefOldSocPubUsr ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RefreshOldTimelineUsr ,NULL},
|
||||||
/* ActWebSvc */{ 892,-1,TabUnk,ActWebSvc ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Plg_WebService ,NULL},
|
/* ActWebSvc */{ 892,-1,TabUnk,ActWebSvc ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Plg_WebService ,NULL},
|
||||||
|
|
||||||
// TabSta ******************************************************************
|
// TabStr ******************************************************************
|
||||||
/* ActFrmLogIn */{1521, 0,TabSta,ActFrmLogIn , 0,0x001,0x001,0x001,0x001,0x001,0x001,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WriteLandingPage ,"power-off" },
|
/* ActFrmLogIn */{1521, 0,TabStr,ActFrmLogIn , 0,0x001,0x001,0x001,0x001,0x001,0x001,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WriteLandingPage ,"power-off" },
|
||||||
/* ActReqSch */{ 627, 1,TabSta,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Sch_ReqSysSearch ,"search" },
|
/* ActReqSch */{ 627, 1,TabStr,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Sch_ReqSysSearch ,"search" },
|
||||||
/* ActSeeSocTmlGbl */{1490, 2,TabSta,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_ShowTimelineGbl2 ,"comment-dots" },
|
/* ActSeeSocTmlGbl */{1490, 2,TabStr,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_ShowTimelineGbl2 ,"comment-dots" },
|
||||||
/* ActSeeSocPrf */{1520, 3,TabSta,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_SeeSocialProfiles ,"user-check" },
|
/* ActSeeSocPrf */{1520, 3,TabStr,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_SeeSocialProfiles ,"user-check" },
|
||||||
/* ActSeeCal */{1622, 4,TabSta,ActSeeCal ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cal_ShowCalendar ,"calendar" },
|
/* ActSeeCal */{1622, 4,TabStr,ActSeeCal ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cal_ShowCalendar ,"calendar" },
|
||||||
/* ActSeeNtf */{ 990, 5,TabSta,ActSeeNtf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ntf_ShowMyNotifications ,"bell" },
|
/* ActSeeNtf */{ 990, 5,TabStr,ActSeeNtf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ntf_ShowMyNotifications ,"bell" },
|
||||||
|
|
||||||
/* ActLogIn */{ 6,-1,TabUnk,ActFrmLogIn ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WelcomeUsr ,NULL},
|
/* ActLogIn */{ 6,-1,TabUnk,ActFrmLogIn ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WelcomeUsr ,NULL},
|
||||||
/* ActLogInNew */{1585,-1,TabUnk,ActFrmLogIn ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WelcomeUsr ,NULL},
|
/* ActLogInNew */{1585,-1,TabUnk,ActFrmLogIn ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WelcomeUsr ,NULL},
|
||||||
|
|
|
@ -464,10 +464,11 @@ En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 18.92.1 (2019-04-01)"
|
#define Log_PLATFORM_VERSION "SWAD 18.92.2 (2019-04-01)"
|
||||||
#define CSS_FILE "swad18.92.css"
|
#define CSS_FILE "swad18.92.css"
|
||||||
#define JS_FILE "swad18.92.js"
|
#define JS_FILE "swad18.92.js"
|
||||||
/*
|
/*
|
||||||
|
Version 18.92.2: Apr 01, 2019 Code refactoring related to user login and actions. (241379 lines)
|
||||||
Version 18.92.1: Apr 01, 2019 Fixed bug in tests, reported by Javier Fernández Baldomero. (241371 lines)
|
Version 18.92.1: Apr 01, 2019 Fixed bug in tests, reported by Javier Fernández Baldomero. (241371 lines)
|
||||||
Version 18.92: Mar 29, 2019 Changes in timeline layout. (241367 lines)
|
Version 18.92: Mar 29, 2019 Changes in timeline layout. (241367 lines)
|
||||||
Version 18.91.1: Mar 29, 2019 Changes in timeline layout. (241345 lines)
|
Version 18.91.1: Mar 29, 2019 Changes in timeline layout. (241345 lines)
|
||||||
|
|
|
@ -86,7 +86,7 @@ const Act_Action_t Mnu_MenuActions[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB
|
||||||
0, // 11
|
0, // 11
|
||||||
0, // 12
|
0, // 12
|
||||||
},
|
},
|
||||||
// TabSta *******************
|
// TabStr *******************
|
||||||
{
|
{
|
||||||
ActFrmLogIn, // 0
|
ActFrmLogIn, // 0
|
||||||
ActReqSch, // 1
|
ActReqSch, // 1
|
||||||
|
|
|
@ -1499,12 +1499,12 @@ void Ntf_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********* Reset my number of new received notifications to 0 ****************/
|
/*************** Reset my number of new notifications to 0 *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Ntf_UpdateMyLastAccessToNotifications (void)
|
static void Ntf_UpdateMyLastAccessToNotifications (void)
|
||||||
{
|
{
|
||||||
/***** Reset to 0 my number of new received messages *****/
|
/***** Reset to 0 my number of new notifications *****/
|
||||||
DB_QueryUPDATE ("can not update last access to notifications",
|
DB_QueryUPDATE ("can not update last access to notifications",
|
||||||
"UPDATE usr_last SET LastAccNotif=NOW()"
|
"UPDATE usr_last SET LastAccNotif=NOW()"
|
||||||
" WHERE UsrCod=%ld",
|
" WHERE UsrCod=%ld",
|
||||||
|
|
|
@ -1168,7 +1168,8 @@ static void Sch_SaveLastSearchIntoSession (void)
|
||||||
// WhatToSearch is stored in usr_last for next time I log in
|
// WhatToSearch is stored in usr_last for next time I log in
|
||||||
// In other existing sessions distinct to this, WhatToSearch will remain unchanged
|
// In other existing sessions distinct to this, WhatToSearch will remain unchanged
|
||||||
DB_QueryUPDATE ("can not update type of search in user's last data",
|
DB_QueryUPDATE ("can not update type of search in user's last data",
|
||||||
"UPDATE usr_last SET WhatToSearch=%u WHERE UsrCod=%ld",
|
"UPDATE usr_last SET WhatToSearch=%u"
|
||||||
|
" WHERE UsrCod=%ld",
|
||||||
(unsigned) Gbl.Search.WhatToSearch,
|
(unsigned) Gbl.Search.WhatToSearch,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ extern struct Globals Gbl;
|
||||||
const char *Tab_TabIcons[Tab_NUM_TABS] =
|
const char *Tab_TabIcons[Tab_NUM_TABS] =
|
||||||
{
|
{
|
||||||
/* TabUnk */ NULL,
|
/* TabUnk */ NULL,
|
||||||
/* TabSta */ "home",
|
/* TabStr */ "home",
|
||||||
/* TabSys */ "sitemap",
|
/* TabSys */ "sitemap",
|
||||||
/* TabCty */ "globe",
|
/* TabCty */ "globe",
|
||||||
/* TabIns */ "university",
|
/* TabIns */ "university",
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
TabUnk = 0,
|
TabUnk = 0,
|
||||||
TabSta = 1,
|
TabStr = 1,
|
||||||
TabSys = 2,
|
TabSys = 2,
|
||||||
TabCty = 3,
|
TabCty = 3,
|
||||||
TabIns = 4,
|
TabIns = 4,
|
||||||
|
|
|
@ -18020,7 +18020,7 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
|
||||||
NULL, // 12
|
NULL, // 12
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// TabSta *****************************************************
|
// TabStr *****************************************************
|
||||||
// 0: ActFrmLogIn
|
// 0: ActFrmLogIn
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Entrar"
|
"Entrar"
|
||||||
|
@ -19827,7 +19827,7 @@ const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
|
||||||
NULL, // 12
|
NULL, // 12
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// TabSta *****************************************************
|
// TabStr *****************************************************
|
||||||
// 0: ActFrmLogIn
|
// 0: ActFrmLogIn
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Rol en aquesta sessió"
|
"Rol en aquesta sessió"
|
||||||
|
@ -41686,7 +41686,7 @@ const char *Txt_TABS_TXT[Tab_NUM_TABS] =
|
||||||
// TabUnk
|
// TabUnk
|
||||||
NULL
|
NULL
|
||||||
,
|
,
|
||||||
// TabSta
|
// TabStr
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Inici"
|
"Inici"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
|
|
@ -1282,7 +1282,8 @@ static void TL_SaveWhichUsersInDB (void)
|
||||||
/***** Update which users in database *****/
|
/***** Update which users in database *****/
|
||||||
// WhichUsrs is stored in usr_last for next time I log in
|
// WhichUsrs is stored in usr_last for next time I log in
|
||||||
DB_QueryUPDATE ("can not update timeline users in user's last data",
|
DB_QueryUPDATE ("can not update timeline users in user's last data",
|
||||||
"UPDATE usr_last SET TimelineUsrs=%u WHERE UsrCod=%ld",
|
"UPDATE usr_last SET TimelineUsrs=%u"
|
||||||
|
" WHERE UsrCod=%ld",
|
||||||
(unsigned) Gbl.Timeline.WhichUsrs,
|
(unsigned) Gbl.Timeline.WhichUsrs,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
}
|
}
|
||||||
|
|
37
swad_user.c
37
swad_user.c
|
@ -789,7 +789,7 @@ static void Usr_GetMyLastData (void)
|
||||||
Gbl.Usrs.Me.UsrLast.LastCrs = Str_ConvertStrCodToLongCod (row[1]);
|
Gbl.Usrs.Me.UsrLast.LastCrs = Str_ConvertStrCodToLongCod (row[1]);
|
||||||
|
|
||||||
/* Get last tab */
|
/* Get last tab */
|
||||||
Gbl.Usrs.Me.UsrLast.LastTab = TabPrf; // By default, set last tab to the profile tab
|
Gbl.Usrs.Me.UsrLast.LastTab = TabStr; // By default, set last tab to the start tab
|
||||||
if (sscanf (row[2],"%u",&UnsignedNum) == 1)
|
if (sscanf (row[2],"%u",&UnsignedNum) == 1)
|
||||||
if (UnsignedNum >= 1 ||
|
if (UnsignedNum >= 1 ||
|
||||||
UnsignedNum <= Tab_NUM_TABS)
|
UnsignedNum <= Tab_NUM_TABS)
|
||||||
|
@ -3090,28 +3090,37 @@ void Usr_ChkUsrAndGetUsrData (void)
|
||||||
{
|
{
|
||||||
// Don't adjust Gbl.Action.Act here
|
// Don't adjust Gbl.Action.Act here
|
||||||
Gbl.Action.Tab = ((Gbl.Usrs.Me.UsrLast.LastTab == TabCrs) &&
|
Gbl.Action.Tab = ((Gbl.Usrs.Me.UsrLast.LastTab == TabCrs) &&
|
||||||
(Gbl.CurrentCrs.Crs.CrsCod <= 0)) ? TabSys :
|
(Gbl.CurrentCrs.Crs.CrsCod <= 0)) ? TabStr :
|
||||||
Gbl.Usrs.Me.UsrLast.LastTab;
|
Gbl.Usrs.Me.UsrLast.LastTab;
|
||||||
Tab_DisableIncompatibleTabs ();
|
Tab_DisableIncompatibleTabs ();
|
||||||
}
|
}
|
||||||
Usr_UpdateMyLastData ();
|
|
||||||
Crs_UpdateCrsLast ();
|
|
||||||
}
|
}
|
||||||
else if (Gbl.Action.Act == ActUnk) // No user logged and unknown action
|
else if (Gbl.Action.Act == ActUnk) // No user logged and unknown action
|
||||||
Act_AdjustActionWhenNoUsrLogged ();
|
Act_AdjustActionWhenNoUsrLogged ();
|
||||||
|
|
||||||
/***** When I change to another tab, go to the first option allowed *****/
|
/***** When I change to another tab, go to:
|
||||||
|
- my last action in that tab if it is known, or
|
||||||
|
- the first option allowed *****/
|
||||||
if (Gbl.Action.Act == ActMnu)
|
if (Gbl.Action.Act == ActMnu)
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Me.Logged)
|
/* Get my last action in current tab */
|
||||||
{
|
Action = (Gbl.Usrs.Me.Logged) ? MFU_GetMyLastActionInCurrentTab () :
|
||||||
if ((Action = MFU_GetMyLastActionInCurrentTab ()) == ActUnk)
|
ActUnk;
|
||||||
Action = Mnu_GetFirstActionAvailableInCurrentTab ();
|
if (Action == ActUnk)
|
||||||
}
|
/* Get the first option allowed */
|
||||||
else
|
|
||||||
Action = Mnu_GetFirstActionAvailableInCurrentTab ();
|
Action = Mnu_GetFirstActionAvailableInCurrentTab ();
|
||||||
if (Action != ActUnk)
|
|
||||||
Gbl.Action.Act = Action;
|
Gbl.Action.Act = (Action == ActUnk) ? ((Gbl.Usrs.Me.Logged) ? ActSeeSocTmlGbl : // Default action if logged
|
||||||
|
ActFrmLogIn) : // Default action if not logged
|
||||||
|
Action;
|
||||||
|
Tab_SetCurrentTab ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Update last data for next time *****/
|
||||||
|
if (Gbl.Usrs.Me.Logged)
|
||||||
|
{
|
||||||
|
Usr_UpdateMyLastData ();
|
||||||
|
Crs_UpdateCrsLast ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3294,8 +3303,6 @@ static void Usr_ShowAlertUsrDoesNotExistsOrWrongPassword (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_user_does_not_exist_or_password_is_incorrect;
|
extern const char *Txt_The_user_does_not_exist_or_password_is_incorrect;
|
||||||
|
|
||||||
// Gbl.Action.Act = ActFrmLogIn;
|
|
||||||
// Tab_SetCurrentTab ();
|
|
||||||
Ale_ShowAlert (Ale_WARNING,Txt_The_user_does_not_exist_or_password_is_incorrect);
|
Ale_ShowAlert (Ale_WARNING,Txt_The_user_does_not_exist_or_password_is_incorrect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue