mirror of https://github.com/acanas/swad-core.git
Version 16.156
This commit is contained in:
parent
e299f48a90
commit
20e0683453
|
@ -209,13 +209,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.155.35 (2017-03-15)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.156 (2017-03-15)"
|
||||
#define CSS_FILE "swad16.147.css"
|
||||
#define JS_FILE "swad16.144.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.156: Mar 15, 2017 Fixed bug in messages, reported by Francisco Ocaña Lara. (217063 lines)
|
||||
Version 16.155.35:Mar 15, 2017 Some help URLs translated to spanish. (217047 lines)
|
||||
Version 16.155.34:Mar 15, 2017 Changes in keywords. (217046 lines)
|
||||
Version 16.155.33:Mar 14, 2017 Some help URLs translated to spanish. (217042 lines)
|
||||
|
|
|
@ -158,6 +158,7 @@ void Msg_FormMsgUsrs (void)
|
|||
Par_GetParAndChangeFormat ("HiddenContent",Content,Cns_MAX_BYTES_LONG_TEXT,
|
||||
Str_TO_TEXT,false);
|
||||
|
||||
/***** Show a form to compose a message to users *****/
|
||||
Msg_PutFormMsgUsrs (Content);
|
||||
}
|
||||
|
||||
|
@ -198,7 +199,6 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1])
|
|||
GetUsrsInCrs = !Gbl.Msg.ShowOnlyOneRecipient && // Show list of potential recipients
|
||||
(Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
||||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
|
||||
|
||||
if (GetUsrsInCrs)
|
||||
{
|
||||
/***** Get and update type of list,
|
||||
|
|
|
@ -347,6 +347,8 @@ bool Ses_GetSessionData (void)
|
|||
void Ses_InsertHiddenParInDB (Act_Action_t Action,const char *ParamName,const char *ParamValue)
|
||||
{
|
||||
char *Query;
|
||||
size_t LengthParamName;
|
||||
size_t LengthParamValue;
|
||||
size_t MaxLength;
|
||||
|
||||
/***** Before of inserting the first hidden parameter passed to the next action,
|
||||
|
@ -354,25 +356,37 @@ void Ses_InsertHiddenParInDB (Act_Action_t Action,const char *ParamName,const ch
|
|||
Ses_RemoveHiddenParFromThisSession ();
|
||||
|
||||
/***** For a unique session-action-parameter, don't insert a parameter more than one time *****/
|
||||
if (!Ses_CheckIfHiddenParIsAlreadyInDB (Action,ParamName))
|
||||
{
|
||||
/***** Allocate space for query *****/
|
||||
MaxLength = 256 + Ses_BYTES_SESSION_ID + strlen (ParamName) + strlen (ParamValue);
|
||||
if ((Query = (char *) malloc (MaxLength + 1)) == NULL)
|
||||
Lay_ShowErrorAndExit ("Not enough memory for query.");
|
||||
if (ParamName)
|
||||
if ((LengthParamName = strlen (ParamName)))
|
||||
if (!Ses_CheckIfHiddenParIsAlreadyInDB (Action,ParamName))
|
||||
{
|
||||
/***** Allocate space for query *****/
|
||||
if (ParamValue)
|
||||
LengthParamValue = strlen (ParamValue);
|
||||
else
|
||||
LengthParamValue = 0;
|
||||
MaxLength = 256 +
|
||||
Ses_BYTES_SESSION_ID +
|
||||
LengthParamName +
|
||||
LengthParamValue;
|
||||
if ((Query = (char *) malloc (MaxLength + 1)) == NULL)
|
||||
Lay_ShowErrorAndExit ("Not enough memory for query.");
|
||||
|
||||
/***** Insert parameter in the database *****/
|
||||
sprintf (Query,"INSERT INTO hidden_params"
|
||||
" (SessionId,Action,ParamName,ParamValue)"
|
||||
" VALUES"
|
||||
" ('%s','%d','%s','%s')",
|
||||
Gbl.Session.Id,(int) Action,ParamName,ParamValue);
|
||||
DB_QueryINSERT (Query,"can not create hidden parameter");
|
||||
Gbl.HiddenParamsInsertedIntoDB = true;
|
||||
/***** Insert parameter in the database *****/
|
||||
sprintf (Query,"INSERT INTO hidden_params"
|
||||
" (SessionId,Action,ParamName,ParamValue)"
|
||||
" VALUES"
|
||||
" ('%s','%d','%s','%s')",
|
||||
Gbl.Session.Id,(int) Action,
|
||||
ParamName,
|
||||
LengthParamValue ? ParamValue :
|
||||
"");
|
||||
DB_QueryINSERT (Query,"can not create hidden parameter");
|
||||
Gbl.HiddenParamsInsertedIntoDB = true;
|
||||
|
||||
/***** Free query *****/
|
||||
free ((void *) Query);
|
||||
}
|
||||
/***** Free query *****/
|
||||
free ((void *) Query);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue