mirror of https://github.com/acanas/swad-core.git
Version 20.51.27: Mar 20, 2021 Debug database table renamed.
This commit is contained in:
parent
3c04014b31
commit
708e50cf16
28
sql/swad.sql
28
sql/swad.sql
|
@ -1,6 +1,18 @@
|
|||
CREATE DATABASE IF NOT EXISTS swad DEFAULT CHARACTER SET=latin1 DEFAULT COLLATE latin1_spanish_ci;
|
||||
USE swad;
|
||||
--
|
||||
-- Table API_keys: stores the keys used in the API / web service
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS API_keys (
|
||||
WSKey CHAR(43) NOT NULL,
|
||||
UsrCod INT NOT NULL,
|
||||
PlgCod INT NOT NULL,
|
||||
LastTime DATETIME NOT NULL,
|
||||
UNIQUE INDEX(WSKey),
|
||||
INDEX(UsrCod),
|
||||
INDEX(PlgCod),
|
||||
INDEX(LastTime));
|
||||
--
|
||||
-- Table IP_prefs: stores user's preferences for each IP address
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS IP_prefs (
|
||||
|
@ -456,9 +468,9 @@ CREATE TABLE IF NOT EXISTS cty_countrs (
|
|||
INDEX(Name_pl),
|
||||
INDEX(Name_pt));
|
||||
--
|
||||
-- Table debug: used for debugging purposes
|
||||
-- Table dbg_debug: used for debugging purposes
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS debug (
|
||||
CREATE TABLE IF NOT EXISTS dbg_debug (
|
||||
DebugTime DATETIME NOT NULL,
|
||||
Txt TEXT NOT NULL,
|
||||
INDEX(DebugTime));
|
||||
|
@ -1772,15 +1784,3 @@ CREATE TABLE IF NOT EXISTS usr_webs (
|
|||
'youtube') NOT NULL,
|
||||
URL VARCHAR(255) NOT NULL,
|
||||
UNIQUE INDEX(UsrCod,Web));
|
||||
--
|
||||
-- Table ws_keys: stores the keys used in plugins and web service
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS ws_keys (
|
||||
WSKey CHAR(43) NOT NULL,
|
||||
UsrCod INT NOT NULL,
|
||||
PlgCod INT NOT NULL,
|
||||
LastTime DATETIME NOT NULL,
|
||||
UNIQUE INDEX(WSKey),
|
||||
INDEX(UsrCod),
|
||||
INDEX(PlgCod),
|
||||
INDEX(LastTime));
|
||||
|
|
23
swad_API.c
23
swad_API.c
|
@ -463,7 +463,10 @@ static int API_CheckWSKey (char WSKey[API_BYTES_WS_KEY + 1])
|
|||
|
||||
/***** Check that key does not exist in database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get existence of key",
|
||||
"SELECT UsrCod,PlgCod FROM ws_keys WHERE WSKey='%s'",
|
||||
"SELECT UsrCod," // row[0]
|
||||
"PlgCod" // row[1]
|
||||
" FROM API_keys"
|
||||
" WHERE WSKey='%s'",
|
||||
WSKey)) // Session found in table of sessions
|
||||
{
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
@ -538,7 +541,7 @@ static int API_GenerateNewWSKey (struct soap *soap,
|
|||
|
||||
/***** Check that key does not exist in database *****/
|
||||
if (DB_QueryCOUNT ("can not get existence of key",
|
||||
"SELECT COUNT(*) FROM ws_keys"
|
||||
"SELECT COUNT(*) FROM API_keys"
|
||||
" WHERE WSKey='%s'",
|
||||
WSKey))
|
||||
return soap_receiver_fault (soap,
|
||||
|
@ -547,7 +550,7 @@ static int API_GenerateNewWSKey (struct soap *soap,
|
|||
|
||||
/***** Insert key into database *****/
|
||||
DB_QueryINSERT ("can not insert new key",
|
||||
"INSERT INTO ws_keys"
|
||||
"INSERT INTO API_keys"
|
||||
" (WSKey,UsrCod,PlgCod,LastTime)"
|
||||
" VALUES"
|
||||
" ('%s',%ld,%ld,NOW())",
|
||||
|
@ -567,7 +570,7 @@ static int API_RemoveOldWSKeys (struct soap *soap)
|
|||
/***** Remove expired sessions *****/
|
||||
/* A session expire when last click (LastTime) is too old,
|
||||
or when there was at least one refresh (navigator supports AJAX) and last refresh is too old (browser probably was closed) */
|
||||
sprintf (Query,"DELETE LOW_PRIORITY FROM ws_keys"
|
||||
sprintf (Query,"DELETE LOW_PRIORITY FROM API_keys"
|
||||
" WHERE LastTime<FROM_UNIXTIME(UNIX_TIMESTAMP()-%lu)",
|
||||
Cfg_TIME_TO_DELETE_WEB_SERVICE_KEY);
|
||||
if (mysql_query (&Gbl.mysql,Query))
|
||||
|
@ -1209,29 +1212,31 @@ int swad__getAvailableRoles (struct soap *soap,
|
|||
Gbl.Usrs.Me.Role.Logged = Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role;
|
||||
|
||||
/***** Return available roles *****/
|
||||
/*
|
||||
DB_QueryINSERT ("can not debug",
|
||||
"INSERT INTO debug"
|
||||
"INSERT INTO dbg_debug"
|
||||
" (DebugTime,Txt)"
|
||||
" VALUES"
|
||||
" (NOW(),'Gbl.Usrs.Me.Role.Available before Rol_SetMyRoles: %u')",
|
||||
Gbl.Usrs.Me.Role.Available);
|
||||
|
||||
*/
|
||||
Rol_SetMyRoles ();
|
||||
getAvailableRolesOut->roles = Gbl.Usrs.Me.Role.Available;
|
||||
/*
|
||||
DB_QueryINSERT ("can not debug",
|
||||
"INSERT INTO debug"
|
||||
"INSERT INTO dbg_debug"
|
||||
" (DebugTime,Txt)"
|
||||
" VALUES"
|
||||
" (NOW(),'Gbl.Usrs.Me.Role.Available after Rol_SetMyRoles: %u')",
|
||||
Gbl.Usrs.Me.Role.Available);
|
||||
|
||||
DB_QueryINSERT ("can not debug",
|
||||
"INSERT INTO debug"
|
||||
"INSERT INTO dbg_debug"
|
||||
" (DebugTime,Txt)"
|
||||
" VALUES"
|
||||
" (NOW(),'getAvailableRolesOut->roles: %d')",
|
||||
getAvailableRolesOut->roles);
|
||||
|
||||
*/
|
||||
return SOAP_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
*/
|
||||
/*
|
||||
DB_QueryINSERT ("can not debug", // TODO: Remove
|
||||
"INSERT INTO debug"
|
||||
"INSERT INTO dbg_debug"
|
||||
" (DebugTime,Txt)"
|
||||
" VALUES"
|
||||
" (NOW(),'ActCod = %ld')",
|
||||
|
@ -600,13 +600,21 @@ TODO: Salvador Romero Cort
|
|||
|
||||
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.51.26 (2021-03-20)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.51.27 (2021-03-20)"
|
||||
#define CSS_FILE "swad20.45.css"
|
||||
#define JS_FILE "swad20.6.2.js"
|
||||
/*
|
||||
TODO: Rename CENTRE to CENTER in help wiki.
|
||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||
|
||||
Version 20.51.27: Mar 20, 2021 API database table renamed. (308219 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE debug TO dbg_debug;
|
||||
|
||||
Version 20.51.27: Mar 20, 2021 API database table renamed. (308212 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE ws_keys TO API_keys;
|
||||
|
||||
Version 20.51.26: Mar 20, 2021 Marks database table renamed. (308209 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE marks_properties TO mrk_marks;
|
||||
|
|
|
@ -3691,9 +3691,9 @@ mysql> DESCRIBE usr_webs;
|
|||
"URL VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW
|
||||
"UNIQUE INDEX(UsrCod,Web))");
|
||||
|
||||
/***** Table ws_keys *****/
|
||||
/***** Table API_keys *****/
|
||||
/*
|
||||
mysql> DESCRIBE ws_keys;
|
||||
mysql> DESCRIBE API_keys;
|
||||
+----------+----------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+----------+----------+------+-----+---------+-------+
|
||||
|
@ -3704,7 +3704,7 @@ mysql> DESCRIBE ws_keys;
|
|||
+----------+----------+------+-----+---------+-------+
|
||||
4 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS ws_keys ("
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS API_keys ("
|
||||
"WSKey CHAR(43) NOT NULL," // API_BYTES_WS_KEY
|
||||
"UsrCod INT NOT NULL,"
|
||||
"PlgCod INT NOT NULL,"
|
||||
|
|
|
@ -1217,7 +1217,7 @@ static void Lay_ShowRightColumn (void)
|
|||
(tv2.tv_usec - tv1.tv_usec);
|
||||
|
||||
DB_QueryINSERT ("can not debug",
|
||||
"INSERT INTO debug"
|
||||
"INSERT INTO dbg_debug"
|
||||
" (DebugTime,Txt)"
|
||||
" VALUES"
|
||||
" (NOW(),'Fol_SuggestUsrsToFollowMainZoneOnRightColumn: %ld us')",
|
||||
|
|
Loading…
Reference in New Issue