mirror of https://github.com/acanas/swad-core.git
Version 16.132.14
This commit is contained in:
parent
df643e1fe9
commit
07d206430d
|
@ -188,18 +188,22 @@
|
|||
// TODO: Fix bug: When registering an administrator, the user's name changes are ignored
|
||||
|
||||
// TODO: In list of indicators, alternate background colors also when not all the number of indicators are selected
|
||||
// TODO: In "Antes de crear una nueva cuenta, compruebe si ya le han inscrito con su ID", force filling of ID
|
||||
|
||||
// TODO: Ver solución de Guillermo Gómez Trenado cuando se pulsa con el botón derecho para abrir una descarga en otra ventana
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.132.13 (2017-02-01)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.132.14 (2017-02-05)"
|
||||
#define CSS_FILE "swad16.132.4.css"
|
||||
#define JS_FILE "swad16.123.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.132.14:Feb 05, 2017 Bug fixing related to AJAX and automatic refresh. (211916 lines)
|
||||
Version 16.132.13:Feb 01, 2017 Global connected in right column is shown only for system admins. (211904 lines)
|
||||
Version 16.132.12:Feb 01, 2017 Code refactoring and bug fixing in parameters related to users list type. (211900 lines)
|
||||
Version 16.132.11:Feb 01, 2017 Help on indicators of courses. (211900 lines)
|
||||
|
|
|
@ -456,11 +456,11 @@
|
|||
#define Cfg_TIME_TO_CLOSE_SESSION_FROM_LAST_REFRESH ((time_t)(Cfg_MAX_TIME_TO_REFRESH_CONNECTED * 2)) // After these seconds without refresh of connected users, session is closed
|
||||
#define Cfg_TIME_TO_CLOSE_SESSION_FROM_LAST_CLICK ((time_t)( 2 * 60UL * 60UL)) // After these seconds without user's clicks, session is closed
|
||||
|
||||
#define Cfg_TIME_TO_REFRESH_LAST_CLICKS ((time_t)( 500UL)) // Refresh period of last clicks in miliseconds
|
||||
#define Cfg_TIME_TO_REFRESH_LAST_CLICKS ((time_t)( 1UL * 1000UL)) // Refresh period of last clicks in miliseconds
|
||||
|
||||
#define Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE ((time_t)( 30UL * 1000UL)) // Refresh period of social timeline in miliseconds
|
||||
|
||||
#define Cfg_TIME_TO_CHANGE_BANNER ((time_t)( 5UL * 60UL)) // After these seconds, change banner
|
||||
#define Cfg_TIME_TO_CHANGE_BANNER ((time_t)( 2UL * 60UL)) // After these seconds, change banner
|
||||
#define Cfg_NUMBER_OF_BANNERS 1 // Number of banners to show simultaneously
|
||||
|
||||
#define Cfg_TIME_TO_DELETE_WEB_SERVICE_KEY ((time_t)( 7UL * 24UL * 60UL * 60UL)) // After these seconds, a web service key is removed
|
||||
|
|
|
@ -1294,7 +1294,7 @@ mysql> DESCRIBE institutions;
|
|||
| FullName | text | NO | | NULL | |
|
||||
| WWW | varchar(255) | NO | | NULL | |
|
||||
+-----------------+--------------+------+-----+---------+----------------+
|
||||
7 rows in set (0.01 sec)
|
||||
7 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS institutions ("
|
||||
"InsCod INT NOT NULL AUTO_INCREMENT,"
|
||||
|
|
|
@ -180,6 +180,7 @@ void Gbl_InitializeGlobals (void)
|
|||
|
||||
Gbl.Action.Act = ActUnk;
|
||||
Gbl.Action.UsesAJAX = false;
|
||||
Gbl.Action.IsAJAXAutoRefresh = false;
|
||||
Gbl.Action.Tab = TabUnk;
|
||||
|
||||
for (Role = (Rol_Role_t) 0;
|
||||
|
@ -437,8 +438,7 @@ void Gbl_Cleanup (void)
|
|||
|
||||
if (!Gbl.Action.UsesAJAX &&
|
||||
!Gbl.WebService.IsWebService &&
|
||||
Act_Actions[Gbl.Action.Act].BrowserWindow == Act_THIS_WINDOW &&
|
||||
!Gbl.HiddenParamsInsertedIntoDB)
|
||||
Act_Actions[Gbl.Action.Act].BrowserWindow == Act_THIS_WINDOW)
|
||||
Ses_RemoveHiddenParFromThisSession ();
|
||||
Usr_FreeMyCourses ();
|
||||
Usr_FreeMyDegrees ();
|
||||
|
|
|
@ -173,7 +173,8 @@ struct Globals
|
|||
{
|
||||
Tab_Tab_t Tab;
|
||||
Act_Action_t Act;
|
||||
bool UsesAJAX;
|
||||
bool UsesAJAX; // Do not generate full HTML page, only the content of a div
|
||||
bool IsAJAXAutoRefresh; // It's an automatic refresh drom time to time
|
||||
} Action;
|
||||
time_t StartExecutionTimeUTC;
|
||||
struct DateTime Now;
|
||||
|
|
|
@ -1473,7 +1473,7 @@ void Lay_ShowErrorAndExit (const char *Message)
|
|||
|
||||
/***** Page is generated (except </body> and </html>).
|
||||
Compute time to generate page *****/
|
||||
if (!Gbl.Action.UsesAJAX)
|
||||
if (!Gbl.Action.IsAJAXAutoRefresh)
|
||||
Sta_ComputeTimeToGeneratePage ();
|
||||
|
||||
if (Gbl.WebService.IsWebService) // Serving a plugin request
|
||||
|
@ -1491,7 +1491,7 @@ void Lay_ShowErrorAndExit (const char *Message)
|
|||
Fil_FastCopyOfOpenFiles (Gbl.F.Out,stdout);
|
||||
Fil_CloseAndRemoveFileForHTMLOutput ();
|
||||
|
||||
if (!Gbl.Action.UsesAJAX)
|
||||
if (!Gbl.Action.IsAJAXAutoRefresh)
|
||||
{
|
||||
/***** Compute time to send page *****/
|
||||
Sta_ComputeTimeToSendPage ();
|
||||
|
|
|
@ -719,12 +719,20 @@ void Par_GetMainParameters (void)
|
|||
Gbl.Action.Act = Act_FromActCodToAction[ActCod];
|
||||
|
||||
/***** Some preliminary adjusts depending on action *****/
|
||||
Gbl.Action.UsesAJAX = false;
|
||||
Gbl.Action.IsAJAXAutoRefresh = false;
|
||||
if (Gbl.Action.Act == ActRefCon ||
|
||||
Gbl.Action.Act == ActRefLstClk ||
|
||||
Gbl.Action.Act == ActRefNewSocPubGbl ||
|
||||
Gbl.Action.Act == ActRefOldSocPubGbl ||
|
||||
Gbl.Action.Act == ActRefOldSocPubUsr)
|
||||
{
|
||||
Gbl.Action.UsesAJAX = true;
|
||||
if (Gbl.Action.Act == ActRefCon ||
|
||||
Gbl.Action.Act == ActRefLstClk ||
|
||||
Gbl.Action.Act == ActRefNewSocPubGbl)
|
||||
Gbl.Action.IsAJAXAutoRefresh = true;
|
||||
}
|
||||
|
||||
/***** Get session identifier, if exists *****/
|
||||
Par_GetParToText ("ses",Gbl.Session.Id,Ses_LENGTH_SESSION_ID);
|
||||
|
|
|
@ -344,8 +344,7 @@ void Ses_InsertHiddenParInDB (Act_Action_t Action,const char *ParamName,const ch
|
|||
|
||||
/***** Before of inserting the first hidden parameter passed to the next action,
|
||||
delete all the parameters coming from the previous action *****/
|
||||
if (!Gbl.HiddenParamsInsertedIntoDB)
|
||||
Ses_RemoveHiddenParFromThisSession ();
|
||||
Ses_RemoveHiddenParFromThisSession ();
|
||||
|
||||
/***** For a unique session-action-parameter, don't insert a parameter more than one time *****/
|
||||
if (!Ses_CheckIfHiddenParIsAlreadyInDB (Action,ParamName))
|
||||
|
@ -365,9 +364,10 @@ void Ses_InsertHiddenParInDB (Act_Action_t Action,const char *ParamName,const ch
|
|||
|
||||
void Ses_RemoveHiddenParFromThisSession (void)
|
||||
{
|
||||
char Query[512];
|
||||
char Query[128 + Ses_LENGTH_SESSION_ID];
|
||||
|
||||
if (Gbl.Session.IsOpen)
|
||||
if (Gbl.Session.IsOpen && // There is an open session
|
||||
!Gbl.HiddenParamsInsertedIntoDB) // No params just inserted
|
||||
{
|
||||
/***** Remove hidden parameters of this session *****/
|
||||
sprintf (Query,"DELETE FROM hidden_params WHERE SessionId='%s'",
|
||||
|
|
|
@ -2510,7 +2510,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
|
||||
if (Gbl.Session.HasBeenDisconnected)
|
||||
{
|
||||
if (Gbl.Action.Act != ActRefCon)
|
||||
if (!Gbl.Action.UsesAJAX)
|
||||
{
|
||||
Gbl.Action.Act = ActLogOut;
|
||||
Tab_SetCurrentTab ();
|
||||
|
@ -2549,7 +2549,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
Gbl.Usrs.Me.Logged = true;
|
||||
Usr_SetUsrRoleAndPrefs ();
|
||||
|
||||
if (Gbl.Action.Act == ActRefCon) // If refreshing connected users ==> don't refresh session
|
||||
if (Gbl.Action.IsAJAXAutoRefresh) // If refreshing ==> don't refresh LastTime in session
|
||||
Ses_UpdateSessionLastRefreshInDB ();
|
||||
else
|
||||
{
|
||||
|
@ -2613,7 +2613,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
}
|
||||
|
||||
/***** Adjust tab and action *****/
|
||||
if (Gbl.Action.Act != ActRefCon)
|
||||
if (!Gbl.Action.UsesAJAX)
|
||||
{
|
||||
if (Gbl.Usrs.Me.Logged)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue