Version 21.39.2: Oct 22, 2021 Fixed bug in settings.

This commit is contained in:
acanas 2021-10-22 09:06:38 +02:00
parent f207d0e1c6
commit b8e24424ed
4 changed files with 32 additions and 28 deletions

View File

@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/
#define Log_PLATFORM_VERSION "SWAD 21.39.1 (2021-10-21)"
#define Log_PLATFORM_VERSION "SWAD 21.39.2 (2021-10-22)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.69.1.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 21.39.2: Oct 22, 2021 Fixed bug in settings. (320544 lines)
Version 21.39.1: Oct 21, 2021 Queries moved to module swad_survey_database. (320540 lines)
Version 21.39: Oct 21, 2021 Fixed bug in nicknames. Reported by Ana Ollarves Reyes. (320487 lines)
Version 21.38.1: Oct 20, 2021 Queries moved to module swad_survey_database. (320522 lines)

View File

@ -144,35 +144,37 @@ void Set_GetSettingsFromIP (void)
if (Gbl.IP[0])
{
/***** Get settings from database *****/
if (Set_DB_GetSettingsFromIP (&mysql_res) != 1)
Err_ShowErrorAndExit ("Internal error while getting settings.");
/***** Get settings from database *****/
row = mysql_fetch_row (mysql_res);
/* Get first day of week (row[0]) */
Gbl.Prefs.FirstDayOfWeek = Cal_GetFirstDayOfWeekFromStr (row[0]);
/* Get date format (row[1]) */
Gbl.Prefs.DateFormat = Dat_GetDateFormatFromStr (row[1]);
/* Get theme (row[2]) */
Gbl.Prefs.Theme = The_GetThemeFromStr (row[2]);
/* Get icon set (row[3]) */
Gbl.Prefs.IconSet = Ico_GetIconSetFromStr (row[3]);
/* Get menu (row[4]) */
Gbl.Prefs.Menu = Mnu_GetMenuFromStr (row[4]);
/* Get if user wants to show side columns (row[5]) */
if (sscanf (row[5],"%u",&Gbl.Prefs.SideCols) == 1)
if (Set_DB_GetSettingsFromIP (&mysql_res))
{
if (Gbl.Prefs.SideCols > Lay_SHOW_BOTH_COLUMNS)
row = mysql_fetch_row (mysql_res);
/* Get first day of week (row[0]) */
Gbl.Prefs.FirstDayOfWeek = Cal_GetFirstDayOfWeekFromStr (row[0]);
/* Get date format (row[1]) */
Gbl.Prefs.DateFormat = Dat_GetDateFormatFromStr (row[1]);
/* Get theme (row[2]) */
Gbl.Prefs.Theme = The_GetThemeFromStr (row[2]);
/* Get icon set (row[3]) */
Gbl.Prefs.IconSet = Ico_GetIconSetFromStr (row[3]);
/* Get menu (row[4]) */
Gbl.Prefs.Menu = Mnu_GetMenuFromStr (row[4]);
/* Get if user wants to show side columns (row[5]) */
if (sscanf (row[5],"%u",&Gbl.Prefs.SideCols) == 1)
{
if (Gbl.Prefs.SideCols > Lay_SHOW_BOTH_COLUMNS)
Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
}
else
Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
}
else
Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
}
}

View File

@ -26,6 +26,7 @@
/*****************************************************************************/
#include <stddef.h> // For NULL
#include <stdlib.h> // For free
#include <string.h> // For string functions
#include "swad_database.h"

View File

@ -29,7 +29,7 @@
// #include <linux/limits.h> // For PATH_MAX
// #include <stddef.h> // For NULL
#include <stdio.h> // For asprintf
// #include <stdlib.h> // For calloc
#include <stdlib.h> // For free
// #include <string.h> // For string functions
// #include "swad_attendance.h"