Version 16.86

This commit is contained in:
Antonio Cañas Vargas 2016-12-04 03:50:25 +01:00
parent 0918d0edee
commit 36dadac279
9 changed files with 195 additions and 129 deletions

View File

@ -956,7 +956,8 @@ Users:
795. ActChgVisFie Request change in visibility of a record field 795. ActChgVisFie Request change in visibility of a record field
796. ActRcvRecCrs Receive and update fields of my record in this course 796. ActRcvRecCrs Receive and update fields of my record in this course
NEW. ActSeeUsrAgd Show user's agenda NEW. ActLogInSeeUsrAgd Log in to show another user's public agenda
NEW. ActSeeUsrAgd Show another user's public agenda
797. ActReqEnrSevStd Request the enrollment/removing of several users to / from current course 797. ActReqEnrSevStd Request the enrollment/removing of several users to / from current course
798. ActReqEnrSevTch Request the enrollment/removing of several users to / from current course 798. ActReqEnrSevTch Request the enrollment/removing of several users to / from current course
@ -2366,6 +2367,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActChgVisFie */{ 297,-1,TabUnk,ActLstStd ,0x110,0x100,0x000,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ChangeVisibilityField ,NULL}, /* ActChgVisFie */{ 297,-1,TabUnk,ActLstStd ,0x110,0x100,0x000,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ChangeVisibilityField ,NULL},
/* ActRcvRecCrs */{ 301,-1,TabUnk,ActLstStd ,0x108,0x100,0x000,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_UpdateAndShowMyCrsRecord ,NULL}, /* ActRcvRecCrs */{ 301,-1,TabUnk,ActLstStd ,0x108,0x100,0x000,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_UpdateAndShowMyCrsRecord ,NULL},
/* ActLogInSeeUsrAgd */{1614,-1,TabUnk,ActLstTch ,0x001,0x001,0x001,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_LogInToShowUsrAgenda ,NULL},
/* ActSeeUsrAgd */{1611,-1,TabUnk,ActLstTch ,0x1FC,0x1FC,0x1FC,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_ShowUsrAgenda ,NULL}, /* ActSeeUsrAgd */{1611,-1,TabUnk,ActLstTch ,0x1FC,0x1FC,0x1FC,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_ShowUsrAgenda ,NULL},
/* ActReqEnrSevStd */{1426,-1,TabUnk,ActLstStd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReqAdminStds ,NULL}, /* ActReqEnrSevStd */{1426,-1,TabUnk,ActLstStd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReqAdminStds ,NULL},
@ -4511,6 +4513,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
ActSeeUsrAgd, // #1611 ActSeeUsrAgd, // #1611
ActHidEvtMyAgd, // #1612 ActHidEvtMyAgd, // #1612
ActShoEvtMyAgd, // #1613 ActShoEvtMyAgd, // #1613
ActLogInSeeUsrAgd, // #1614
}; };
/*****************************************************************************/ /*****************************************************************************/

View File

@ -55,9 +55,9 @@ typedef enum
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_NUM_ACTIONS (1+9+51+14+93+73+70+249+186+156+172+36+31+95) #define Act_NUM_ACTIONS (1+9+51+14+93+73+70+249+186+157+172+36+31+95)
#define Act_MAX_ACTION_COD 1613 #define Act_MAX_ACTION_COD 1614
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 11 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 11
@ -972,127 +972,128 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
#define ActChgVisFie (ActChgNumRowFooGrp+ 50) #define ActChgVisFie (ActChgNumRowFooGrp+ 50)
#define ActRcvRecCrs (ActChgNumRowFooGrp+ 51) #define ActRcvRecCrs (ActChgNumRowFooGrp+ 51)
#define ActSeeUsrAgd (ActChgNumRowFooGrp+ 52) #define ActLogInSeeUsrAgd (ActChgNumRowFooGrp+ 52)
#define ActSeeUsrAgd (ActChgNumRowFooGrp+ 53)
#define ActReqEnrSevStd (ActChgNumRowFooGrp+ 53) #define ActReqEnrSevStd (ActChgNumRowFooGrp+ 54)
#define ActReqEnrSevTch (ActChgNumRowFooGrp+ 54) #define ActReqEnrSevTch (ActChgNumRowFooGrp+ 55)
#define ActReqLstStdAtt (ActChgNumRowFooGrp+ 55) #define ActReqLstStdAtt (ActChgNumRowFooGrp+ 56)
#define ActSeeLstMyAtt (ActChgNumRowFooGrp+ 56) #define ActSeeLstMyAtt (ActChgNumRowFooGrp+ 57)
#define ActPrnLstMyAtt (ActChgNumRowFooGrp+ 57) #define ActPrnLstMyAtt (ActChgNumRowFooGrp+ 58)
#define ActSeeLstStdAtt (ActChgNumRowFooGrp+ 58) #define ActSeeLstStdAtt (ActChgNumRowFooGrp+ 59)
#define ActPrnLstStdAtt (ActChgNumRowFooGrp+ 59) #define ActPrnLstStdAtt (ActChgNumRowFooGrp+ 60)
#define ActFrmNewAtt (ActChgNumRowFooGrp+ 60) #define ActFrmNewAtt (ActChgNumRowFooGrp+ 61)
#define ActEdiOneAtt (ActChgNumRowFooGrp+ 61) #define ActEdiOneAtt (ActChgNumRowFooGrp+ 62)
#define ActNewAtt (ActChgNumRowFooGrp+ 62) #define ActNewAtt (ActChgNumRowFooGrp+ 63)
#define ActChgAtt (ActChgNumRowFooGrp+ 63) #define ActChgAtt (ActChgNumRowFooGrp+ 64)
#define ActReqRemAtt (ActChgNumRowFooGrp+ 64) #define ActReqRemAtt (ActChgNumRowFooGrp+ 65)
#define ActRemAtt (ActChgNumRowFooGrp+ 65) #define ActRemAtt (ActChgNumRowFooGrp+ 66)
#define ActHidAtt (ActChgNumRowFooGrp+ 66) #define ActHidAtt (ActChgNumRowFooGrp+ 67)
#define ActShoAtt (ActChgNumRowFooGrp+ 67) #define ActShoAtt (ActChgNumRowFooGrp+ 68)
#define ActSeeOneAtt (ActChgNumRowFooGrp+ 68) #define ActSeeOneAtt (ActChgNumRowFooGrp+ 69)
#define ActRecAttStd (ActChgNumRowFooGrp+ 69) #define ActRecAttStd (ActChgNumRowFooGrp+ 70)
#define ActRecAttMe (ActChgNumRowFooGrp+ 70) #define ActRecAttMe (ActChgNumRowFooGrp+ 71)
#define ActSignUp (ActChgNumRowFooGrp+ 71) #define ActSignUp (ActChgNumRowFooGrp+ 72)
#define ActUpdSignUpReq (ActChgNumRowFooGrp+ 72) #define ActUpdSignUpReq (ActChgNumRowFooGrp+ 73)
#define ActReqRejSignUp (ActChgNumRowFooGrp+ 73) #define ActReqRejSignUp (ActChgNumRowFooGrp+ 74)
#define ActRejSignUp (ActChgNumRowFooGrp+ 74) #define ActRejSignUp (ActChgNumRowFooGrp+ 75)
#define ActReqMdfOneOth (ActChgNumRowFooGrp+ 75) #define ActReqMdfOneOth (ActChgNumRowFooGrp+ 76)
#define ActReqMdfOneStd (ActChgNumRowFooGrp+ 76) #define ActReqMdfOneStd (ActChgNumRowFooGrp+ 77)
#define ActReqMdfOneTch (ActChgNumRowFooGrp+ 77) #define ActReqMdfOneTch (ActChgNumRowFooGrp+ 78)
#define ActReqMdfOth (ActChgNumRowFooGrp+ 78) #define ActReqMdfOth (ActChgNumRowFooGrp+ 79)
#define ActReqMdfStd (ActChgNumRowFooGrp+ 79) #define ActReqMdfStd (ActChgNumRowFooGrp+ 80)
#define ActReqMdfTch (ActChgNumRowFooGrp+ 80) #define ActReqMdfTch (ActChgNumRowFooGrp+ 81)
#define ActReqOthPho (ActChgNumRowFooGrp+ 81) #define ActReqOthPho (ActChgNumRowFooGrp+ 82)
#define ActReqStdPho (ActChgNumRowFooGrp+ 82) #define ActReqStdPho (ActChgNumRowFooGrp+ 83)
#define ActReqTchPho (ActChgNumRowFooGrp+ 83) #define ActReqTchPho (ActChgNumRowFooGrp+ 84)
#define ActDetOthPho (ActChgNumRowFooGrp+ 84) #define ActDetOthPho (ActChgNumRowFooGrp+ 85)
#define ActDetStdPho (ActChgNumRowFooGrp+ 85) #define ActDetStdPho (ActChgNumRowFooGrp+ 86)
#define ActDetTchPho (ActChgNumRowFooGrp+ 86) #define ActDetTchPho (ActChgNumRowFooGrp+ 87)
#define ActUpdOthPho (ActChgNumRowFooGrp+ 87) #define ActUpdOthPho (ActChgNumRowFooGrp+ 88)
#define ActUpdStdPho (ActChgNumRowFooGrp+ 88) #define ActUpdStdPho (ActChgNumRowFooGrp+ 89)
#define ActUpdTchPho (ActChgNumRowFooGrp+ 89) #define ActUpdTchPho (ActChgNumRowFooGrp+ 90)
#define ActReqRemOthPho (ActChgNumRowFooGrp+ 90) #define ActReqRemOthPho (ActChgNumRowFooGrp+ 91)
#define ActReqRemStdPho (ActChgNumRowFooGrp+ 91) #define ActReqRemStdPho (ActChgNumRowFooGrp+ 92)
#define ActReqRemTchPho (ActChgNumRowFooGrp+ 92) #define ActReqRemTchPho (ActChgNumRowFooGrp+ 93)
#define ActRemOthPho (ActChgNumRowFooGrp+ 93) #define ActRemOthPho (ActChgNumRowFooGrp+ 94)
#define ActRemStdPho (ActChgNumRowFooGrp+ 94) #define ActRemStdPho (ActChgNumRowFooGrp+ 95)
#define ActRemTchPho (ActChgNumRowFooGrp+ 95) #define ActRemTchPho (ActChgNumRowFooGrp+ 96)
#define ActCreOth (ActChgNumRowFooGrp+ 96) #define ActCreOth (ActChgNumRowFooGrp+ 97)
#define ActCreStd (ActChgNumRowFooGrp+ 97) #define ActCreStd (ActChgNumRowFooGrp+ 98)
#define ActCreTch (ActChgNumRowFooGrp+ 98) #define ActCreTch (ActChgNumRowFooGrp+ 99)
#define ActUpdOth (ActChgNumRowFooGrp+ 99) #define ActUpdOth (ActChgNumRowFooGrp+100)
#define ActUpdStd (ActChgNumRowFooGrp+100) #define ActUpdStd (ActChgNumRowFooGrp+101)
#define ActUpdTch (ActChgNumRowFooGrp+101) #define ActUpdTch (ActChgNumRowFooGrp+102)
#define ActReqAccEnrStd (ActChgNumRowFooGrp+102) #define ActReqAccEnrStd (ActChgNumRowFooGrp+103)
#define ActReqAccEnrTch (ActChgNumRowFooGrp+103) #define ActReqAccEnrTch (ActChgNumRowFooGrp+104)
#define ActAccEnrStd (ActChgNumRowFooGrp+104) #define ActAccEnrStd (ActChgNumRowFooGrp+105)
#define ActAccEnrTch (ActChgNumRowFooGrp+105) #define ActAccEnrTch (ActChgNumRowFooGrp+106)
#define ActRemMe_Std (ActChgNumRowFooGrp+106) #define ActRemMe_Std (ActChgNumRowFooGrp+107)
#define ActRemMe_Tch (ActChgNumRowFooGrp+107) #define ActRemMe_Tch (ActChgNumRowFooGrp+108)
#define ActNewAdmIns (ActChgNumRowFooGrp+108) #define ActNewAdmIns (ActChgNumRowFooGrp+109)
#define ActRemAdmIns (ActChgNumRowFooGrp+109) #define ActRemAdmIns (ActChgNumRowFooGrp+110)
#define ActNewAdmCtr (ActChgNumRowFooGrp+110) #define ActNewAdmCtr (ActChgNumRowFooGrp+111)
#define ActRemAdmCtr (ActChgNumRowFooGrp+111) #define ActRemAdmCtr (ActChgNumRowFooGrp+112)
#define ActNewAdmDeg (ActChgNumRowFooGrp+112) #define ActNewAdmDeg (ActChgNumRowFooGrp+113)
#define ActRemAdmDeg (ActChgNumRowFooGrp+113) #define ActRemAdmDeg (ActChgNumRowFooGrp+114)
#define ActRcvFrmEnrSevStd (ActChgNumRowFooGrp+114) #define ActRcvFrmEnrSevStd (ActChgNumRowFooGrp+115)
#define ActRcvFrmEnrSevTch (ActChgNumRowFooGrp+115) #define ActRcvFrmEnrSevTch (ActChgNumRowFooGrp+116)
#define ActReqCnfID_Oth (ActChgNumRowFooGrp+116) #define ActReqCnfID_Oth (ActChgNumRowFooGrp+117)
#define ActReqCnfID_Std (ActChgNumRowFooGrp+117) #define ActReqCnfID_Std (ActChgNumRowFooGrp+118)
#define ActReqCnfID_Tch (ActChgNumRowFooGrp+118) #define ActReqCnfID_Tch (ActChgNumRowFooGrp+119)
#define ActCnfID_Oth (ActChgNumRowFooGrp+119) #define ActCnfID_Oth (ActChgNumRowFooGrp+120)
#define ActCnfID_Std (ActChgNumRowFooGrp+120) #define ActCnfID_Std (ActChgNumRowFooGrp+121)
#define ActCnfID_Tch (ActChgNumRowFooGrp+121) #define ActCnfID_Tch (ActChgNumRowFooGrp+122)
#define ActFrmIDsOth (ActChgNumRowFooGrp+122) #define ActFrmIDsOth (ActChgNumRowFooGrp+123)
#define ActFrmIDsStd (ActChgNumRowFooGrp+123) #define ActFrmIDsStd (ActChgNumRowFooGrp+124)
#define ActFrmIDsTch (ActChgNumRowFooGrp+124) #define ActFrmIDsTch (ActChgNumRowFooGrp+125)
#define ActRemID_Oth (ActChgNumRowFooGrp+125) #define ActRemID_Oth (ActChgNumRowFooGrp+126)
#define ActRemID_Std (ActChgNumRowFooGrp+126) #define ActRemID_Std (ActChgNumRowFooGrp+127)
#define ActRemID_Tch (ActChgNumRowFooGrp+127) #define ActRemID_Tch (ActChgNumRowFooGrp+128)
#define ActNewID_Oth (ActChgNumRowFooGrp+128) #define ActNewID_Oth (ActChgNumRowFooGrp+129)
#define ActNewID_Std (ActChgNumRowFooGrp+129) #define ActNewID_Std (ActChgNumRowFooGrp+130)
#define ActNewID_Tch (ActChgNumRowFooGrp+130) #define ActNewID_Tch (ActChgNumRowFooGrp+131)
#define ActFrmPwdOth (ActChgNumRowFooGrp+131) #define ActFrmPwdOth (ActChgNumRowFooGrp+132)
#define ActFrmPwdStd (ActChgNumRowFooGrp+132) #define ActFrmPwdStd (ActChgNumRowFooGrp+133)
#define ActFrmPwdTch (ActChgNumRowFooGrp+133) #define ActFrmPwdTch (ActChgNumRowFooGrp+134)
#define ActChgPwdOth (ActChgNumRowFooGrp+134) #define ActChgPwdOth (ActChgNumRowFooGrp+135)
#define ActChgPwdStd (ActChgNumRowFooGrp+135) #define ActChgPwdStd (ActChgNumRowFooGrp+136)
#define ActChgPwdTch (ActChgNumRowFooGrp+136) #define ActChgPwdTch (ActChgNumRowFooGrp+137)
#define ActFrmMaiOth (ActChgNumRowFooGrp+137) #define ActFrmMaiOth (ActChgNumRowFooGrp+138)
#define ActFrmMaiStd (ActChgNumRowFooGrp+138) #define ActFrmMaiStd (ActChgNumRowFooGrp+139)
#define ActFrmMaiTch (ActChgNumRowFooGrp+139) #define ActFrmMaiTch (ActChgNumRowFooGrp+140)
#define ActRemMaiOth (ActChgNumRowFooGrp+140) #define ActRemMaiOth (ActChgNumRowFooGrp+141)
#define ActRemMaiStd (ActChgNumRowFooGrp+141) #define ActRemMaiStd (ActChgNumRowFooGrp+142)
#define ActRemMaiTch (ActChgNumRowFooGrp+142) #define ActRemMaiTch (ActChgNumRowFooGrp+143)
#define ActNewMaiOth (ActChgNumRowFooGrp+143) #define ActNewMaiOth (ActChgNumRowFooGrp+144)
#define ActNewMaiStd (ActChgNumRowFooGrp+144) #define ActNewMaiStd (ActChgNumRowFooGrp+145)
#define ActNewMaiTch (ActChgNumRowFooGrp+145) #define ActNewMaiTch (ActChgNumRowFooGrp+146)
#define ActRemStdCrs (ActChgNumRowFooGrp+146) #define ActRemStdCrs (ActChgNumRowFooGrp+147)
#define ActRemTchCrs (ActChgNumRowFooGrp+147) #define ActRemTchCrs (ActChgNumRowFooGrp+148)
#define ActRemUsrGbl (ActChgNumRowFooGrp+148) #define ActRemUsrGbl (ActChgNumRowFooGrp+149)
#define ActReqRemAllStdCrs (ActChgNumRowFooGrp+149) #define ActReqRemAllStdCrs (ActChgNumRowFooGrp+150)
#define ActRemAllStdCrs (ActChgNumRowFooGrp+150) #define ActRemAllStdCrs (ActChgNumRowFooGrp+151)
#define ActReqRemOldUsr (ActChgNumRowFooGrp+151) #define ActReqRemOldUsr (ActChgNumRowFooGrp+152)
#define ActRemOldUsr (ActChgNumRowFooGrp+152) #define ActRemOldUsr (ActChgNumRowFooGrp+153)
#define ActLstDupUsr (ActChgNumRowFooGrp+153) #define ActLstDupUsr (ActChgNumRowFooGrp+154)
#define ActLstSimUsr (ActChgNumRowFooGrp+154) #define ActLstSimUsr (ActChgNumRowFooGrp+155)
#define ActRemDupUsr (ActChgNumRowFooGrp+155) #define ActRemDupUsr (ActChgNumRowFooGrp+156)
#define ActLstClk (ActChgNumRowFooGrp+156) #define ActLstClk (ActChgNumRowFooGrp+157)
/*****************************************************************************/ /*****************************************************************************/
/******************************** Social tab *********************************/ /******************************** Social tab *********************************/

View File

@ -95,6 +95,21 @@ static void Agd_UpdateEvent (struct AgendaEvent *AgdEvent,const char *Txt);
/************************ Show another user's agenda *************************/ /************************ Show another user's agenda *************************/
/*****************************************************************************/ /*****************************************************************************/
void Agd_LogInToShowUsrAgenda (void)
{
/***** Check if user exists and get her/his data *****/
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat);
/***** Form to log in *****/
/* Put the form to log in always, even if user does not exist,
to not give clues about whether a user exists or not */
Usr_WriteFormLogin (ActSeeUsrAgd,Usr_PutParamOtherUsrCodEncrypted);
}
/*****************************************************************************/
/************************ Show another user's agenda *************************/
/*****************************************************************************/
void Agd_ShowUsrAgenda (void) void Agd_ShowUsrAgenda (void)
{ {
extern const char *Txt_User_not_found_or_you_do_not_have_permission_; extern const char *Txt_User_not_found_or_you_do_not_have_permission_;

View File

@ -74,6 +74,7 @@ typedef enum
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
void Agd_LogInToShowUsrAgenda (void);
void Agd_ShowUsrAgenda (void); void Agd_ShowUsrAgenda (void);
void Agd_ShowMyAgenda (void); void Agd_ShowMyAgenda (void);

View File

@ -183,13 +183,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.85.1 (2016-12-03)" #define Log_PLATFORM_VERSION "SWAD 16.86 (2016-12-04)"
#define CSS_FILE "swad16.82.2.css" #define CSS_FILE "swad16.82.2.css"
#define JS_FILE "swad16.84.2.js" #define JS_FILE "swad16.84.2.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.86: Dec 04, 2016 New action to log in and show another user's agenda when not logged. (209781 lines)
Version 16.85.1: Dec 03, 2016 Changed title of public agenda. (209722 lines) Version 16.85.1: Dec 03, 2016 Changed title of public agenda. (209722 lines)
Version 16.85: Dec 03, 2016 Form to choice between all events / only public events in agenda. (209721 lines) Version 16.85: Dec 03, 2016 Form to choice between all events / only public events in agenda. (209721 lines)
Version 16.84.2: Dec 03, 2016 Only hours and minutes (seconds = 0) in agenda events. (209606 lines) Version 16.84.2: Dec 03, 2016 Only hours and minutes (seconds = 0) in agenda events. (209606 lines)

View File

@ -1732,7 +1732,7 @@ void Mai_ConfirmEmail (void)
Lay_ShowAlert (Lay_WARNING,Txt_Failed_email_confirmation_key); Lay_ShowAlert (Lay_WARNING,Txt_Failed_email_confirmation_key);
/***** Form to log in *****/ /***** Form to log in *****/
Usr_WriteFormLogin (); Usr_WriteFormLogin (ActAutUsrInt,NULL);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -619,6 +619,7 @@ static bool Par_CheckIsParamCanBeUsedInGETMethod (const char *ParamName)
"deg", // To enter directly to a degree "deg", // To enter directly to a degree
"crs", // To enter directly to a course "crs", // To enter directly to a course
"usr", // To enter directly to a user's profile "usr", // To enter directly to a user's profile
"agd", // To view user's public agenda
"act", // To execute directly an action (allowed only for fully public actions) "act", // To execute directly an action (allowed only for fully public actions)
"ses", // To use an open session when redirecting from one language to another "ses", // To use an open session when redirecting from one language to another
"key", // To verify an email address "key", // To verify an email address
@ -673,6 +674,7 @@ void Par_GetMainParameters (void)
(this nickname is used to go to another user's profile, (this nickname is used to go to another user's profile,
not to get the logged user) *****/ not to get the logged user) *****/
if (Par_GetParToText ("usr",Nickname,Nck_MAX_BYTES_NICKNAME_WITH_ARROBA)) if (Par_GetParToText ("usr",Nickname,Nck_MAX_BYTES_NICKNAME_WITH_ARROBA))
{
if (Nickname[0]) if (Nickname[0])
{ {
// This user's code is used to go to public profile // This user's code is used to go to public profile
@ -681,6 +683,17 @@ void Par_GetMainParameters (void)
Gbl.Usrs.Other.UsrDat.UsrCod = Nck_GetUsrCodFromNickname (Nickname); Gbl.Usrs.Other.UsrDat.UsrCod = Nck_GetUsrCodFromNickname (Nickname);
Gbl.Action.Act = ActSeePubPrf; // Set default action if no other is specified Gbl.Action.Act = ActSeePubPrf; // Set default action if no other is specified
} }
}
else if (Par_GetParToText ("agd",Nickname,Nck_MAX_BYTES_NICKNAME_WITH_ARROBA))
{
if (Nickname[0])
{
// This user's code is used to go to public agenda
// If user does not exist ==> UsrCod = -1
Gbl.Usrs.Other.UsrDat.UsrCod = Nck_GetUsrCodFromNickname (Nickname);
Gbl.Action.Act = ActLogInSeeUsrAgd; // Set default action if no other is specified
}
}
/***** Get action to perform *****/ /***** Get action to perform *****/
Par_GetParToText ("act",UnsignedStr,10); Par_GetParToText ("act",UnsignedStr,10);
@ -699,12 +712,17 @@ void Par_GetMainParameters (void)
if (UnsignedNum <= Act_MAX_ACTION_COD) if (UnsignedNum <= Act_MAX_ACTION_COD)
Gbl.Action.Act = Act_FromActCodToAction[UnsignedNum]; Gbl.Action.Act = Act_FromActCodToAction[UnsignedNum];
} }
/***** Some preliminary adjusts depending on action *****/
if (Gbl.Action.Act == ActRefCon || if (Gbl.Action.Act == ActRefCon ||
Gbl.Action.Act == ActRefLstClk || Gbl.Action.Act == ActRefLstClk ||
Gbl.Action.Act == ActRefNewSocPubGbl || Gbl.Action.Act == ActRefNewSocPubGbl ||
Gbl.Action.Act == ActRefOldSocPubGbl || Gbl.Action.Act == ActRefOldSocPubGbl ||
Gbl.Action.Act == ActRefOldSocPubUsr) Gbl.Action.Act == ActRefOldSocPubUsr)
Gbl.Action.UsesAJAX = true; Gbl.Action.UsesAJAX = true;
else if (Gbl.Action.Act == ActSeeUsrAgd)
// It's necessary to do this here when log in to view user's agenda fails
Usr_GetParamOtherUsrCodEncrypted (&Gbl.Usrs.Other.UsrDat);
/***** Get session identifier, if exists *****/ /***** Get session identifier, if exists *****/
Par_GetParToText ("ses",Gbl.Session.Id,Ses_LENGTH_SESSION_ID); Par_GetParToText ("ses",Gbl.Session.Id,Ses_LENGTH_SESSION_ID);
@ -740,6 +758,8 @@ void Par_GetMainParameters (void)
switch (Gbl.Action.Act) switch (Gbl.Action.Act)
{ {
case ActAutUsrInt: case ActAutUsrInt:
case ActLogInSeeUsrAgd:
case ActSeeUsrAgd:
Pwd_GetParamUsrPwdLogin (); Pwd_GetParamUsrPwdLogin ();
// no break; // no break;
case ActReqSndNewPwd: case ActReqSndNewPwd:

View File

@ -406,7 +406,7 @@ void Usr_GetUsrCodFromEncryptedUsrCod (struct UsrData *UsrDat)
/*****************************************************************************/ /*****************************************************************************/
// Input: UsrDat->UsrCod must hold user's code // Input: UsrDat->UsrCod must hold user's code
void Usr_GetEncryptedUsrCodFromUsrCod (struct UsrData *UsrDat) void Usr_GetEncryptedUsrCodFromUsrCod (struct UsrData *UsrDat) // TODO: Remove this funcion, it's not used
{ {
char Query[512]; char Query[512];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -1683,7 +1683,7 @@ bool Usr_ChkIfEncryptedUsrCodExists (const char *EncryptedUsrCod)
void Usr_WriteLandingPage (void) void Usr_WriteLandingPage (void)
{ {
/***** Form to log in *****/ /***** Form to log in *****/
Usr_WriteFormLogin (); Usr_WriteFormLogin (ActAutUsrInt,NULL);
/***** Form to go to request the creation of a new account *****/ /***** Form to go to request the creation of a new account *****/
Acc_ShowFormGoToRequestNewAccount (); Acc_ShowFormGoToRequestNewAccount ();
@ -1714,7 +1714,7 @@ void Usr_Logout (void)
Lay_ShowAlert (Lay_INFO,Txt_The_session_has_been_closed); Lay_ShowAlert (Lay_INFO,Txt_The_session_has_been_closed);
/***** Form to log in *****/ /***** Form to log in *****/
Usr_WriteFormLogin (); Usr_WriteFormLogin (ActAutUsrInt,NULL);
/***** Advertisement about mobile app *****/ /***** Advertisement about mobile app *****/
Lay_AdvertisementMobile (); Lay_AdvertisementMobile ();
@ -1738,7 +1738,7 @@ void Usr_PutLinkToLogin (void)
/************************ Write form for user log in *************************/ /************************ Write form for user log in *************************/
/*****************************************************************************/ /*****************************************************************************/
void Usr_WriteFormLogin (void) void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) ())
{ {
extern const char *Hlp_PROFILE_Log_in; extern const char *Hlp_PROFILE_Log_in;
extern const char *Txt_Log_in; extern const char *Txt_Log_in;
@ -1756,9 +1756,14 @@ void Usr_WriteFormLogin (void)
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
/***** Start form *****/
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">"); fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
Act_FormStart (ActAutUsrInt);
/***** Start form *****/
Act_FormStart (NextAction);
if (FuncParams)
FuncParams ();
/***** Start frame and table *****/
Lay_StartRoundFrameTable (NULL,Txt_Log_in,NULL,Hlp_PROFILE_Log_in,2); Lay_StartRoundFrameTable (NULL,Txt_Log_in,NULL,Hlp_PROFILE_Log_in,2);
/***** User's ID/nickname and password *****/ /***** User's ID/nickname and password *****/
@ -1798,8 +1803,10 @@ void Usr_WriteFormLogin (void)
Pwd_MAX_LENGTH_PLAIN_PASSWORD, Pwd_MAX_LENGTH_PLAIN_PASSWORD,
Txt_password); Txt_password);
/***** Send button and form end *****/ /***** Send button and end table and frame *****/
Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Log_in); Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Log_in);
/***** End form *****/
Act_FormEnd (); Act_FormEnd ();
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
@ -2195,7 +2202,17 @@ bool Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (void)
void Usr_ChkUsrAndGetUsrData (void) void Usr_ChkUsrAndGetUsrData (void)
{ {
extern const char *Txt_The_session_has_expired_due_to_inactivity; extern const char *Txt_The_session_has_expired_due_to_inactivity;
bool PutFormLogin = false; struct
{
bool PutForm;
Act_Action_t Action;
void (*FuncParams) ();
} FormLogin =
{
false,
ActAutUsrInt,
NULL
};
Act_Action_t Action; Act_Action_t Action;
if (Gbl.Session.HasBeenDisconnected) if (Gbl.Session.HasBeenDisconnected)
@ -2205,7 +2222,7 @@ void Usr_ChkUsrAndGetUsrData (void)
Gbl.Action.Act = ActLogOut; Gbl.Action.Act = ActLogOut;
Tab_SetCurrentTab (); Tab_SetCurrentTab ();
Lay_ShowAlert (Lay_WARNING,Txt_The_session_has_expired_due_to_inactivity); Lay_ShowAlert (Lay_WARNING,Txt_The_session_has_expired_due_to_inactivity);
PutFormLogin = true; FormLogin.PutForm = true;
} }
} }
else // !Gbl.Session.HasBeenDisconnected else // !Gbl.Session.HasBeenDisconnected
@ -2249,9 +2266,10 @@ void Usr_ChkUsrAndGetUsrData (void)
} }
} }
else else
PutFormLogin = true; FormLogin.PutForm = true;
} }
else if (Gbl.Action.Act == ActAutUsrInt) // Login using @nickname, email or ID from form else if (Gbl.Action.Act == ActAutUsrInt ||
Gbl.Action.Act == ActSeeUsrAgd) // Login using @nickname, email or ID from form
{ {
if (Usr_ChkUsrAndGetUsrDataFromDirectLogin ()) // User logged in if (Usr_ChkUsrAndGetUsrDataFromDirectLogin ()) // User logged in
{ {
@ -2264,7 +2282,14 @@ void Usr_ChkUsrAndGetUsrData (void)
Pre_SetPrefsFromIP (); // Set preferences from current IP Pre_SetPrefsFromIP (); // Set preferences from current IP
} }
else else
PutFormLogin = true; {
FormLogin.PutForm = true;
if (Gbl.Action.Act == ActSeeUsrAgd)
{
FormLogin.Action = ActSeeUsrAgd;
FormLogin.FuncParams = Usr_PutParamOtherUsrCodEncrypted;
}
}
} }
else if (Gbl.Action.Act == ActAutUsrNew) // Empty account without password, login using encrypted user's code else if (Gbl.Action.Act == ActAutUsrNew) // Empty account without password, login using encrypted user's code
{ {
@ -2282,15 +2307,15 @@ void Usr_ChkUsrAndGetUsrData (void)
Pre_SetPrefsFromIP (); // Set preferences from current IP Pre_SetPrefsFromIP (); // Set preferences from current IP
} }
else else
PutFormLogin = true; FormLogin.PutForm = true;
} }
} }
} }
/***** If session disconnected or error in login, show form to login *****/ /***** If session disconnected or error in login, show form to login *****/
if (PutFormLogin) if (FormLogin.PutForm)
{ {
Usr_WriteFormLogin (); Usr_WriteFormLogin (FormLogin.Action,FormLogin.FuncParams);
Lay_ShowErrorAndExit (NULL); Lay_ShowErrorAndExit (NULL);
} }
@ -2508,8 +2533,8 @@ 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; // Gbl.Action.Act = ActFrmLogIn;
Tab_SetCurrentTab (); // Tab_SetCurrentTab ();
Lay_ShowAlert (Lay_WARNING,Txt_The_user_does_not_exist_or_password_is_incorrect); Lay_ShowAlert (Lay_WARNING,Txt_The_user_does_not_exist_or_password_is_incorrect);
} }

View File

@ -215,7 +215,7 @@ void Usr_GetAllUsrDataFromUsrCod (struct UsrData *UsrDat);
void Usr_AllocateListUsrCods (struct ListUsrCods *ListUsrCods); void Usr_AllocateListUsrCods (struct ListUsrCods *ListUsrCods);
void Usr_FreeListUsrCods (struct ListUsrCods *ListUsrCods); void Usr_FreeListUsrCods (struct ListUsrCods *ListUsrCods);
void Usr_GetUsrCodFromEncryptedUsrCod (struct UsrData *UsrDat); void Usr_GetUsrCodFromEncryptedUsrCod (struct UsrData *UsrDat);
void Usr_GetEncryptedUsrCodFromUsrCod (struct UsrData *UsrDat); void Usr_GetEncryptedUsrCodFromUsrCod (struct UsrData *UsrDat); // TODO: Remove this funcion, it's not used
void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat); void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat);
void Usr_BuildFullName (struct UsrData *UsrDat); void Usr_BuildFullName (struct UsrData *UsrDat);
@ -278,7 +278,7 @@ void Usr_WriteLandingPage (void);
void Usr_WriteFormLogout (void); void Usr_WriteFormLogout (void);
void Usr_Logout (void); void Usr_Logout (void);
void Usr_PutLinkToLogin (void); void Usr_PutLinkToLogin (void);
void Usr_WriteFormLogin (void); void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) ());
void Usr_WelcomeUsr (void); void Usr_WelcomeUsr (void);
void Usr_CreateBirthdayStrDB (const struct UsrData *UsrDat, void Usr_CreateBirthdayStrDB (const struct UsrData *UsrDat,