Version 16.208.2

This commit is contained in:
Antonio Cañas Vargas 2017-05-08 19:54:05 +02:00
parent fd493a5313
commit 6e73ea98ac
4 changed files with 27 additions and 18 deletions

View File

@ -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,"<input type=\"hidden\" name=\"UsrID\" value=\"%s\" />",
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 *****/

View File

@ -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)

View File

@ -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

View File

@ -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');
}