From 6e73ea98acc90676a2965af74a375eade8e65132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 8 May 2017 19:54:05 +0200 Subject: [PATCH] Version 16.208.2 --- swad_ID.c | 39 +++++++++++++++++++++++---------------- swad_changelog.h | 3 ++- swad_global.h | 1 + swad_record.c | 2 +- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/swad_ID.c b/swad_ID.c index 0e9441ad2..ded3724ee 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -71,7 +71,8 @@ typedef enum static bool ID_CheckIfUsrIDIsValidUsingMinDigits (const char *UsrID,unsigned MinDigits); static void ID_PutButtonToReqConfirmID (struct UsrData *UsrDat,unsigned NumID); -static void ID_PutButtonToConfirmID (struct UsrData *UsrDat,unsigned NumID); +static void ID_PutButtonToConfirmID (unsigned NumID); +static void ID_PutParamsConfirmID (void); static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe); static bool ID_CheckIfConfirmed (long UsrCod,const char *UsrID); @@ -470,18 +471,30 @@ static void ID_PutButtonToReqConfirmID (struct UsrData *UsrDat,unsigned NumID) /**************** Put a button to confirm another user's ID ******************/ /*****************************************************************************/ -static void ID_PutButtonToConfirmID (struct UsrData *UsrDat,unsigned NumID) +static void ID_PutButtonToConfirmID (unsigned NumID) { + extern const char *Txt_Do_you_want_to_confirm_the_ID_X; extern const char *Txt_Confirm_ID; - Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActCnfID_Std : - (UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ActCnfID_Tch : - ActCnfID_Oth)); // Guest, visitor or admin - Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); + Gbl.Usrs.Other.NumIDToConfirm = NumID; + + /***** Ask for confirmation *****/ + sprintf (Gbl.Title,Txt_Do_you_want_to_confirm_the_ID_X, + Gbl.Usrs.Other.UsrDat.IDs.List[NumID].ID); + Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Title); + Lay_ShowAlertAndButton2 ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActCnfID_Std : + (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER ? ActCnfID_Tch : + ActCnfID_Oth), // Guest, visitor or admin + NULL, + ID_PutParamsConfirmID, + Lay_CREATE_BUTTON,Txt_Confirm_ID); + } + +static void ID_PutParamsConfirmID (void) + { + Usr_PutParamOtherUsrCodEncrypted (); fprintf (Gbl.F.Out,"", - UsrDat->IDs.List[NumID].ID); - Lay_PutCreateButton (Txt_Confirm_ID); - Act_FormEnd (); + Gbl.Usrs.Other.UsrDat.IDs.List[Gbl.Usrs.Other.NumIDToConfirm].ID); } /*****************************************************************************/ @@ -957,7 +970,6 @@ void ID_ConfirmOtherUsrID (void) static void ID_ReqConfOrConfOtherUsrID (ID_ReqConfOrConfID_t ReqConfOrConfID) { extern const char *Txt_ID_X_had_already_been_confirmed; - extern const char *Txt_Do_you_want_to_confirm_the_ID_X; extern const char *Txt_The_ID_X_has_been_confirmed; extern const char *Txt_User_not_found_or_you_do_not_have_permission_; char UsrID[ID_MAX_BYTES_USR_ID + 1]; @@ -1004,13 +1016,8 @@ static void ID_ReqConfOrConfOtherUsrID (ID_ReqConfOrConfID_t ReqConfOrConfID) switch (ReqConfOrConfID) { case ID_REQUEST_CONFIRM_ID: // Ask if confirm ID - /***** Ask for confirmation *****/ - sprintf (Gbl.Message,Txt_Do_you_want_to_confirm_the_ID_X, - Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID); - Lay_ShowAlert (Lay_INFO,Gbl.Message); - /***** Put button to confirm ID *****/ - ID_PutButtonToConfirmID (&Gbl.Usrs.Other.UsrDat,NumIDFound); + ID_PutButtonToConfirmID (NumIDFound); break; case ID_CONFIRM_ID: // Confirm ID /***** Mark this ID as confirmed *****/ diff --git a/swad_changelog.h b/swad_changelog.h index 71296dc7f..9c536e7e0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -234,13 +234,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.208.1 (2017-05-08)" +#define Log_PLATFORM_VERSION "SWAD 16.208.2 (2017-05-08)" #define CSS_FILE "swad16.207.css" #define JS_FILE "swad16.206.3.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.208.2: May 08, 2017 Changes in confirmation of user's ID. (218704 lines) Version 16.208.1: May 08, 2017 Fixed problem in character encoding in files of marks, reported by Sandra Daniela Tazzioli Barroso. (218696 lines) Version 16.208: May 07, 2017 New module swad_language for preference on language. (218695 lines) Version 16.207.2: May 07, 2017 Changes in help on preferences. (218621 lines) diff --git a/swad_global.h b/swad_global.h index d0e9b6fda..b390b5f98 100644 --- a/swad_global.h +++ b/swad_global.h @@ -367,6 +367,7 @@ struct Globals struct { struct UsrData UsrDat; + unsigned NumIDToConfirm; // Used as hidden parameter to confirm a user's ID } Other; // Another user, used for example to register in / remove from a course struct ListUsrs LstUsrs[Rol_NUM_ROLES]; struct diff --git a/swad_record.c b/swad_record.c index af622ceb2..49fea014b 100644 --- a/swad_record.c +++ b/swad_record.c @@ -1503,7 +1503,7 @@ static void Rec_WriteFormShowOfficeHoursSeveralTchs (bool ShowOfficeHours) static void Rec_PutParamsShowOfficeHoursOneTch (void) { - Usr_PutParamUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); + Usr_PutParamOtherUsrCodEncrypted (); Par_PutHiddenParamChar ("ParamOfficeHours",'Y'); }