Version 16.132.14

This commit is contained in:
Antonio Cañas Vargas 2017-02-05 22:23:41 +01:00
parent df643e1fe9
commit 07d206430d
9 changed files with 29 additions and 16 deletions

View File

@ -188,18 +188,22 @@
// TODO: Fix bug: When registering an administrator, the user's name changes are ignored // 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 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 *****************************/ /****************************** 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 CSS_FILE "swad16.132.4.css"
#define JS_FILE "swad16.123.js" #define JS_FILE "swad16.123.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.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.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.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) Version 16.132.11:Feb 01, 2017 Help on indicators of courses. (211900 lines)

View File

@ -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_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_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_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_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 #define Cfg_TIME_TO_DELETE_WEB_SERVICE_KEY ((time_t)( 7UL * 24UL * 60UL * 60UL)) // After these seconds, a web service key is removed

View File

@ -1294,7 +1294,7 @@ mysql> DESCRIBE institutions;
| FullName | text | NO | | NULL | | | FullName | text | NO | | NULL | |
| WWW | varchar(255) | 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 (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS institutions ("
"InsCod INT NOT NULL AUTO_INCREMENT," "InsCod INT NOT NULL AUTO_INCREMENT,"

View File

@ -180,6 +180,7 @@ void Gbl_InitializeGlobals (void)
Gbl.Action.Act = ActUnk; Gbl.Action.Act = ActUnk;
Gbl.Action.UsesAJAX = false; Gbl.Action.UsesAJAX = false;
Gbl.Action.IsAJAXAutoRefresh = false;
Gbl.Action.Tab = TabUnk; Gbl.Action.Tab = TabUnk;
for (Role = (Rol_Role_t) 0; for (Role = (Rol_Role_t) 0;
@ -437,8 +438,7 @@ void Gbl_Cleanup (void)
if (!Gbl.Action.UsesAJAX && if (!Gbl.Action.UsesAJAX &&
!Gbl.WebService.IsWebService && !Gbl.WebService.IsWebService &&
Act_Actions[Gbl.Action.Act].BrowserWindow == Act_THIS_WINDOW && Act_Actions[Gbl.Action.Act].BrowserWindow == Act_THIS_WINDOW)
!Gbl.HiddenParamsInsertedIntoDB)
Ses_RemoveHiddenParFromThisSession (); Ses_RemoveHiddenParFromThisSession ();
Usr_FreeMyCourses (); Usr_FreeMyCourses ();
Usr_FreeMyDegrees (); Usr_FreeMyDegrees ();

View File

@ -173,7 +173,8 @@ struct Globals
{ {
Tab_Tab_t Tab; Tab_Tab_t Tab;
Act_Action_t Act; 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; } Action;
time_t StartExecutionTimeUTC; time_t StartExecutionTimeUTC;
struct DateTime Now; struct DateTime Now;

View File

@ -1473,7 +1473,7 @@ void Lay_ShowErrorAndExit (const char *Message)
/***** Page is generated (except </body> and </html>). /***** Page is generated (except </body> and </html>).
Compute time to generate page *****/ Compute time to generate page *****/
if (!Gbl.Action.UsesAJAX) if (!Gbl.Action.IsAJAXAutoRefresh)
Sta_ComputeTimeToGeneratePage (); Sta_ComputeTimeToGeneratePage ();
if (Gbl.WebService.IsWebService) // Serving a plugin request 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_FastCopyOfOpenFiles (Gbl.F.Out,stdout);
Fil_CloseAndRemoveFileForHTMLOutput (); Fil_CloseAndRemoveFileForHTMLOutput ();
if (!Gbl.Action.UsesAJAX) if (!Gbl.Action.IsAJAXAutoRefresh)
{ {
/***** Compute time to send page *****/ /***** Compute time to send page *****/
Sta_ComputeTimeToSendPage (); Sta_ComputeTimeToSendPage ();

View File

@ -719,12 +719,20 @@ void Par_GetMainParameters (void)
Gbl.Action.Act = Act_FromActCodToAction[ActCod]; Gbl.Action.Act = Act_FromActCodToAction[ActCod];
/***** Some preliminary adjusts depending on action *****/ /***** Some preliminary adjusts depending on action *****/
Gbl.Action.UsesAJAX = false;
Gbl.Action.IsAJAXAutoRefresh = false;
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;
if (Gbl.Action.Act == ActRefCon ||
Gbl.Action.Act == ActRefLstClk ||
Gbl.Action.Act == ActRefNewSocPubGbl)
Gbl.Action.IsAJAXAutoRefresh = true;
}
/***** 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);

View File

@ -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, /***** Before of inserting the first hidden parameter passed to the next action,
delete all the parameters coming from the previous 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 *****/ /***** For a unique session-action-parameter, don't insert a parameter more than one time *****/
if (!Ses_CheckIfHiddenParIsAlreadyInDB (Action,ParamName)) 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) 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 *****/ /***** Remove hidden parameters of this session *****/
sprintf (Query,"DELETE FROM hidden_params WHERE SessionId='%s'", sprintf (Query,"DELETE FROM hidden_params WHERE SessionId='%s'",

View File

@ -2510,7 +2510,7 @@ void Usr_ChkUsrAndGetUsrData (void)
if (Gbl.Session.HasBeenDisconnected) if (Gbl.Session.HasBeenDisconnected)
{ {
if (Gbl.Action.Act != ActRefCon) if (!Gbl.Action.UsesAJAX)
{ {
Gbl.Action.Act = ActLogOut; Gbl.Action.Act = ActLogOut;
Tab_SetCurrentTab (); Tab_SetCurrentTab ();
@ -2549,7 +2549,7 @@ void Usr_ChkUsrAndGetUsrData (void)
Gbl.Usrs.Me.Logged = true; Gbl.Usrs.Me.Logged = true;
Usr_SetUsrRoleAndPrefs (); 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 (); Ses_UpdateSessionLastRefreshInDB ();
else else
{ {
@ -2613,7 +2613,7 @@ void Usr_ChkUsrAndGetUsrData (void)
} }
/***** Adjust tab and action *****/ /***** Adjust tab and action *****/
if (Gbl.Action.Act != ActRefCon) if (!Gbl.Action.UsesAJAX)
{ {
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {