Version18.86

This commit is contained in:
Antonio Cañas Vargas 2019-03-22 15:21:46 +01:00
parent c4b60ebe1c
commit 3ad087f987
20 changed files with 301 additions and 197 deletions

View File

@ -3555,6 +3555,13 @@ a.PAG:hover, .PAG_CUR
{
width:90px;
}
/********************************* Privacy *********************************/
.PRI_LIST
{
width:100%;
}
/********************************* Page foot *********************************/
@media only screen and (max-width: 800px)

View File

@ -12687,6 +12687,7 @@ SELECT degrees.ShortName,main_degree.MaxRole
WHERE degrees.DegCod=main_degree.DegCod;
ALTER TABLE usr_data CHANGE COLUMN BasicProfileVisibility BaPrfVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown';
ALTER TABLE usr_data DROP COLUMN ExtendedProfileVisibility;

View File

@ -1314,7 +1314,8 @@ CREATE TABLE IF NOT EXISTS usr_data (
DateFormat TINYINT NOT NULL DEFAULT 0,
Photo CHAR(43) NOT NULL DEFAULT '',
PhotoVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',
ProfileVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',
BaPrfVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',
ExPrfVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',
CtyCod INT NOT NULL DEFAULT -1,
InsCtyCod INT NOT NULL DEFAULT -1,
InsCod INT NOT NULL DEFAULT -1,
@ -1342,7 +1343,8 @@ CREATE TABLE IF NOT EXISTS usr_data (
INDEX(FirstDayOfWeek),
INDEX(DateFormat),
INDEX(PhotoVisibility),
INDEX(ProfileVisibility),
INDEX(BaPrfVisibility),
INDEX(ExPrfVisibility),
INDEX(CtyCod),
INDEX(InsCtyCod),
INDEX(InsCod),

View File

@ -732,7 +732,7 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat,bool CreatingMyOwnAccount)
" (EncryptedUsrCod,Password,"
"Surname1,Surname2,FirstName,Sex,"
"Theme,IconSet,Language,FirstDayOfWeek,DateFormat,"
"PhotoVisibility,ProfileVisibility,"
"PhotoVisibility,BaPrfVisibility,ExPrfVisibility,"
"CtyCod,"
"LocalAddress,LocalPhone,"
"FamilyAddress,FamilyPhone,"
@ -742,7 +742,7 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat,bool CreatingMyOwnAccount)
" ('%s','%s',"
"'%s','%s','%s','%s',"
"'%s','%s','%s',%u,%u,"
"'%s','%s',"
"'%s','%s','%s',"
"%ld,"
"'%s','%s',"
"'%s','%s','%s',"
@ -758,7 +758,8 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat,bool CreatingMyOwnAccount)
Cal_FIRST_DAY_OF_WEEK_DEFAULT,
(unsigned) Dat_FORMAT_DEFAULT,
Pri_VisibilityDB[UsrDat->PhotoVisibility],
Pri_VisibilityDB[UsrDat->ProfileVisibility],
Pri_VisibilityDB[UsrDat->BaPrfVisibility],
Pri_VisibilityDB[UsrDat->ExPrfVisibility],
UsrDat->CtyCod,
UsrDat->LocalAddress ,UsrDat->LocalPhone,
UsrDat->FamilyAddress,UsrDat->FamilyPhone,UsrDat->OriginPlace,

View File

@ -1557,7 +1557,8 @@ Profile:
1323. ActChgIco Change icon set
1324. ActChgMnu Change menu
1325. ActChgPriPho Change privacy of my photo
1326. ActChgPriPrf Change privacy of my public profile
1326. ActChgBasPriPrf Change privacy of my basic public profile
NEW. ActChgExtPriPrf Change privacy of my extended public profile
NEW. ActChgCooPrf Change preference about third party cookies
1327. ActChgNtfPrf Change whether to notify by email new messages
1328. ActPrnUsrQR Show my QR code ready to print
@ -3143,7 +3144,8 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActChgIco */{1092,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,Ico_ChangeIconSet ,Pre_EditPrefs ,NULL},
/* ActChgMnu */{1243,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,Mnu_ChangeMenu ,Pre_EditPrefs ,NULL},
/* ActChgPriPho */{ 774,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Pho_ChangePhotoVisibility ,NULL},
/* ActChgPriPrf */{1404,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_ChangeProfileVisibility ,NULL},
/* ActChgBasPriPrf */{1404,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_ChangeBasicProfileVis ,NULL},
/* ActChgExtPriPrf */{1765,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_ChangeExtendedProfileVis ,NULL},
/* ActChgCooPrf */{1764,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Coo_ChangeMyPrefsCookies ,NULL},
/* ActChgNtfPrf */{ 775,-1,TabUnk,ActReqEdiPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Ntf_ChangeNotifyEvents ,Pre_EditPrefs ,NULL},
@ -4561,7 +4563,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActReqOthPubPrf, // #1401
ActSeeOthPubPrf, // #1402
-1, // #1403 (obsolete action)
ActChgPriPrf, // #1404
ActChgBasPriPrf, // #1404
ActCalFig, // #1405
-1, // #1406 (obsolete action)
-1, // #1407 (obsolete action)
@ -4922,6 +4924,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActUnfSevStd, // #1762
ActUnfSevTch, // #1763
ActChgCooPrf, // #1764
ActChgExtPriPrf, // #1765
};
/*****************************************************************************/
@ -5249,8 +5252,9 @@ void Act_AdjustCurrentAction (void)
If any of my preferences about privacy is unknown
the only action possible
is to show a form to change my preferences *****/
if (Gbl.Usrs.Me.UsrDat.PhotoVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.ProfileVisibility == Pri_VISIBILITY_UNKNOWN)
if (Gbl.Usrs.Me.UsrDat.PhotoVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.BaPrfVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.ExPrfVisibility == Pri_VISIBILITY_UNKNOWN)
{
Gbl.Action.Act = ActReqEdiPrf;
Tab_SetCurrentTab ();

View File

@ -61,9 +61,9 @@ typedef enum
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_NUM_ACTIONS (1 + 8 + 55 + 38 + 12 + 42 + 36 + 19 + 110 + 157 + 437 + 176 + 168 + 15 + 66)
#define Act_NUM_ACTIONS (1 + 8 + 55 + 38 + 12 + 42 + 36 + 19 + 110 + 157 + 437 + 176 + 168 + 15 + 67)
#define Act_MAX_ACTION_COD 1764
#define Act_MAX_ACTION_COD 1765
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
@ -1589,16 +1589,17 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActChgIco (ActSeeMyUsgRep + 56)
#define ActChgMnu (ActSeeMyUsgRep + 57)
#define ActChgPriPho (ActSeeMyUsgRep + 58)
#define ActChgPriPrf (ActSeeMyUsgRep + 59)
#define ActChgCooPrf (ActSeeMyUsgRep + 60)
#define ActChgNtfPrf (ActSeeMyUsgRep + 61)
#define ActChgBasPriPrf (ActSeeMyUsgRep + 59)
#define ActChgExtPriPrf (ActSeeMyUsgRep + 60)
#define ActChgCooPrf (ActSeeMyUsgRep + 61)
#define ActChgNtfPrf (ActSeeMyUsgRep + 62)
#define ActPrnUsrQR (ActSeeMyUsgRep + 62)
#define ActPrnUsrQR (ActSeeMyUsgRep + 63)
#define ActPrnMyTT (ActSeeMyUsgRep + 63)
#define ActEdiTut (ActSeeMyUsgRep + 64)
#define ActChgTut (ActSeeMyUsgRep + 65)
#define ActChgMyTT1stDay (ActSeeMyUsgRep + 66)
#define ActPrnMyTT (ActSeeMyUsgRep + 64)
#define ActEdiTut (ActSeeMyUsgRep + 65)
#define ActChgTut (ActSeeMyUsgRep + 66)
#define ActChgMyTT1stDay (ActSeeMyUsgRep + 67)
/*****************************************************************************/
/******************************** Public types *******************************/

View File

@ -667,7 +667,7 @@ static void Agd_PutIconsOtherPublicAgenda (void)
extern const char *Txt_View_record_and_office_hours;
/***** Button to view user's public profile *****/
if (Pri_ShowingIsAllowed (Gbl.Usrs.Other.UsrDat.ProfileVisibility,
if (Pri_ShowingIsAllowed (Gbl.Usrs.Other.UsrDat.BaPrfVisibility,
&Gbl.Usrs.Other.UsrDat))
Lay_PutContextualLinkOnlyIcon (ActSeeOthPubPrf,NULL,
Usr_PutParamOtherUsrCodEncrypted,

View File

@ -459,10 +459,20 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.85.3 (2019-03-22)"
#define Log_PLATFORM_VERSION "SWAD 18.86 (2019-03-22)"
#define CSS_FILE "swad18.85.1.css"
#define JS_FILE "swad18.85.js"
/*
Version 18.86: Mar 22, 2019 Profile visibility is splitted into basic and extended.
Fixed bug storing media in database. (240928 lines)
6 changes necessary in database:
ALTER TABLE usr_data CHANGE COLUMN ProfileVisibility BaPrfVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown';
ALTER TABLE usr_data ADD COLUMN ExPrfVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown' AFTER BaPrfVisibility,ADD INDEX (ExPrfVisibility);
UPDATE usr_data SET ExPrfVisibility=BaPrfVisibility;
UPDATE usr_data SET BaPrfVisibility='system' WHERE BaPrfVisibility IN ('unknown','user','course');
UPDATE actions SET Txt='Cambiar priv. perfil público básico' WHERE ActCod='1404' AND Language='es';
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1765','es','N','Cambiar priv. perfil público extendido');
Version 18.85.3: Mar 22, 2019 Code refactoring related to third-party cookies. (240833 lines)
Version 18.85.2: Mar 22, 2019 Changed text related to third-party cookies. (240837 lines)
Version 18.85.1: Mar 21, 2019 Fixed bug in form to link YouTube videos.

View File

@ -2779,7 +2779,8 @@ mysql> DESCRIBE usr_data;
| DateFormat | tinyint(4) | NO | MUL | 0 | |
| Photo | char(43) | NO | | | |
| PhotoVisibility | enum('unknown','user','course','system','world') | NO | MUL | unknown | |
| ProfileVisibility | enum('unknown','user','course','system','world') | NO | MUL | unknown | |
| BaPrfVisibility | enum('unknown','user','course','system','world') | NO | MUL | unknown | |
| ExPrfVisibility | enum('unknown','user','course','system','world') | NO | MUL | unknown | |
| CtyCod | int(11) | NO | MUL | -1 | |
| InsCtyCod | int(11) | NO | MUL | -1 | |
| InsCod | int(11) | NO | MUL | -1 | |
@ -2800,7 +2801,7 @@ mysql> DESCRIBE usr_data;
| NotifNtfEvents | int(11) | NO | | 0 | |
| EmailNtfEvents | int(11) | NO | | 0 | |
+-------------------+--------------------------------------------------+------+-----+---------+----------------+
34 rows in set (0.00 sec)
35 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS usr_data ("
"UsrCod INT NOT NULL AUTO_INCREMENT,"
@ -2817,7 +2818,8 @@ mysql> DESCRIBE usr_data;
"DateFormat TINYINT NOT NULL DEFAULT 0,"
"Photo CHAR(43) NOT NULL DEFAULT ''," // Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64
"PhotoVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',"
"ProfileVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',"
"BaPrfVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',"
"ExPrfVisibility ENUM('unknown','user','course','system','world') NOT NULL DEFAULT 'unknown',"
"CtyCod INT NOT NULL DEFAULT -1,"
"InsCtyCod INT NOT NULL DEFAULT -1,"
"InsCod INT NOT NULL DEFAULT -1,"
@ -2845,7 +2847,8 @@ mysql> DESCRIBE usr_data;
"INDEX(FirstDayOfWeek),"
"INDEX(DateFormat),"
"INDEX(PhotoVisibility),"
"INDEX(ProfileVisibility),"
"INDEX(BaPrfVisibility),"
"INDEX(ExPrfVisibility),"
"INDEX(CtyCod),"
"INDEX(InsCtyCod),"
"INDEX(InsCod),"

View File

@ -168,7 +168,8 @@ static void Fig_GetAndShowMsgsStats (void);
static void Fig_GetAndShowSurveysStats (void);
static void Fig_GetAndShowNumUsrsPerPrivacy (void);
static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,const char *FieldName);
static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,
const char *FieldName);
static void Fig_GetAndShowNumUsrsPerCookies (void);
static void Fig_GetAndShowNumUsrsPerLanguage (void);
static void Fig_GetAndShowNumUsrsPerFirstDayOfWeek (void);
@ -179,7 +180,6 @@ static void Fig_GetAndShowNumUsrsPerTheme (void);
static void Fig_GetAndShowNumUsrsPerSideColumns (void);
unsigned Fig_GetNumUsrsWhoChoseAnOption (const char *SubQuery);
/*****************************************************************************/
/************************** Show use of the platform *************************/
/*****************************************************************************/
@ -4807,7 +4807,8 @@ static void Fig_GetAndShowNumUsrsPerPrivacy (void)
{
extern const char *Hlp_ANALYTICS_Figures_privacy;
extern const char *Txt_Photo;
extern const char *Txt_Public_profile;
extern const char *Txt_Basic_public_profile;
extern const char *Txt_Extended_public_profile;
extern const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES];
/***** Start box and table *****/
@ -4815,10 +4816,14 @@ static void Fig_GetAndShowNumUsrsPerPrivacy (void)
Hlp_ANALYTICS_Figures_privacy,Box_NOT_CLOSABLE,2);
/***** Privacy for photo *****/
Fig_GetAndShowNumUsrsPerPrivacyForAnObject (Txt_Photo,"PhotoVisibility");
Fig_GetAndShowNumUsrsPerPrivacyForAnObject (Txt_Photo,
"PhotoVisibility");
/***** Privacy for public profile *****/
Fig_GetAndShowNumUsrsPerPrivacyForAnObject (Txt_Public_profile,"ProfileVisibility");
Fig_GetAndShowNumUsrsPerPrivacyForAnObject (Txt_Basic_public_profile,
"BaPrfVisibility");
Fig_GetAndShowNumUsrsPerPrivacyForAnObject (Txt_Extended_public_profile,
"ExPrfVisibility");
/***** End table and box *****/
Box_EndBoxTable ();
@ -4828,7 +4833,8 @@ static void Fig_GetAndShowNumUsrsPerPrivacy (void)
/********** Get and show number of users who have chosen a privacy ***********/
/*****************************************************************************/
static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,const char *FieldName)
static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,
const char *FieldName)
{
extern const char *Txt_No_of_users;
extern const char *Txt_PERCENT_of_users;

View File

@ -318,7 +318,7 @@ static unsigned long Fol_GetUsrsWhoToFollow (unsigned long MaxUsrsToShow,
" WHERE usr_follow.FollowerCod=my_followed.FollowedCod"
" AND usr_follow.FollowedCod<>%ld"
" AND usr_follow.FollowedCod=usr_data.UsrCod"
" AND usr_data.ProfileVisibility IN ('%s','%s')"
" AND usr_data.BaPrfVisibility IN ('%s','%s')"
" AND usr_data.Surname1<>''" // Surname 1 not empty
" AND usr_data.FirstName<>''" // First name not empty
"%s" // SubQuery1
@ -336,7 +336,7 @@ static unsigned long Fol_GetUsrsWhoToFollow (unsigned long MaxUsrsToShow,
" WHERE crs_usr.CrsCod=my_crs.CrsCod"
" AND crs_usr.UsrCod<>%ld"
" AND crs_usr.UsrCod=usr_data.UsrCod"
" AND usr_data.ProfileVisibility IN ('%s','%s','%s')"
" AND usr_data.BaPrfVisibility IN ('%s','%s','%s')"
" AND usr_data.Surname1<>''" // Surname 1 not empty
" AND usr_data.FirstName<>''" // First name not empty
"%s" // SubQuery2
@ -353,7 +353,7 @@ static unsigned long Fol_GetUsrsWhoToFollow (unsigned long MaxUsrsToShow,
" WHERE crs_usr.CrsCod=my_crs_role.CrsCod"
" AND crs_usr.Role<>my_crs_role.Role"
" AND crs_usr.UsrCod=usr_data.UsrCod"
" AND usr_data.ProfileVisibility='%s'"
" AND usr_data.BaPrfVisibility='%s'"
" AND usr_data.Surname1<>''" // Surname 1 not empty
" AND usr_data.FirstName<>''" // First name not empty
"%s" // SubQuery3
@ -373,7 +373,7 @@ static unsigned long Fol_GetUsrsWhoToFollow (unsigned long MaxUsrsToShow,
// Pri_VISIBILITY_SYSTEM or Pri_VISIBILITY_WORLD
"SELECT UsrCod FROM usr_data"
" WHERE UsrCod<>%ld"
" AND ProfileVisibility IN ('%s','%s')"
" AND BaPrfVisibility IN ('%s','%s')"
" AND Surname1<>''" // Surname 1 not empty
" AND FirstName<>''" // First name not empty
"%s" // SubQuery4
@ -842,7 +842,7 @@ static void Fol_ShowFollowedOrFollower (struct UsrData *UsrDat)
extern const char *Txt_Another_user_s_profile;
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
bool Visible = Pri_ShowingIsAllowed (UsrDat->ProfileVisibility,UsrDat);
bool Visible = Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat);
bool ItsMe = Usr_ItsMe (UsrDat->UsrCod);
/***** Show user's photo *****/
@ -898,7 +898,7 @@ static void Fol_WriteRowUsrToFollowOnRightColumn (struct UsrData *UsrDat)
extern const char *Txt_Another_user_s_profile;
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
bool Visible = Pri_ShowingIsAllowed (UsrDat->ProfileVisibility,UsrDat);
bool Visible = Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat);
bool ItsMe = Usr_ItsMe (UsrDat->UsrCod);
/***** Show user's photo *****/

View File

@ -1145,7 +1145,7 @@ static void Med_GetAndProcessYouTubeFromForm (const char *ParamURL,
Media->Name[CodeLength] = '\0';
/* Set media type and status */
Media->Type = Med_EMBED;
Media->Type = Med_YOUTUBE;
Media->Status = Med_PROCESSED;
}
else

View File

@ -82,15 +82,17 @@ void Pri_EditMyPrivacy (void)
extern const char *Txt_Please_review_your_privacy_preferences;
extern const char *Txt_Privacy;
extern const char *Txt_Photo;
extern const char *Txt_Public_profile;
extern const char *Txt_Basic_public_profile;
extern const char *Txt_Extended_public_profile;
extern const char *Txt_Timeline;
/***** Start section with preferences on privacy *****/
Lay_StartSection (Pri_PRIVACY_ID);
/***** If any of my preferences about privacy is unknown *****/
if (Gbl.Usrs.Me.UsrDat.PhotoVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.ProfileVisibility == Pri_VISIBILITY_UNKNOWN)
if (Gbl.Usrs.Me.UsrDat.PhotoVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.BaPrfVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.ExPrfVisibility == Pri_VISIBILITY_UNKNOWN)
Ale_ShowAlert (Ale_WARNING,Txt_Please_review_your_privacy_preferences);
/***** Start box and table *****/
@ -101,25 +103,25 @@ void Pri_EditMyPrivacy (void)
Pri_PutFormVisibility (Txt_Photo,
ActChgPriPho,"VisPho",
Gbl.Usrs.Me.UsrDat.PhotoVisibility,
(1 << Pri_VISIBILITY_USER) |
(1 << Pri_VISIBILITY_COURSE) |
(1 << Pri_VISIBILITY_SYSTEM) |
(1 << Pri_VISIBILITY_WORLD));
Pri_PHOTO_ALLOWED_VIS);
/***** Edit public profile visibility *****/
Pri_PutFormVisibility (Txt_Public_profile,
ActChgPriPrf,"VisPrf",
Gbl.Usrs.Me.UsrDat.ProfileVisibility,
(1 << Pri_VISIBILITY_USER) |
(1 << Pri_VISIBILITY_COURSE) |
(1 << Pri_VISIBILITY_SYSTEM) |
(1 << Pri_VISIBILITY_WORLD));
/***** Edit basic public profile visibility *****/
Pri_PutFormVisibility (Txt_Basic_public_profile,
ActChgBasPriPrf,"VisBasPrf",
Gbl.Usrs.Me.UsrDat.BaPrfVisibility,
Pri_BASIC_PROFILE_ALLOWED_VIS);
/***** Edit extended public profile visibility *****/
Pri_PutFormVisibility (Txt_Extended_public_profile,
ActChgExtPriPrf,"VisExtPrf",
Gbl.Usrs.Me.UsrDat.ExPrfVisibility,
Pri_EXTENDED_PROFILE_ALLOWED_VIS);
/***** Edit public activity (timeline) visibility *****/
Pri_PutFormVisibility (Txt_Timeline,
ActUnk,"VisTml",
Pri_VISIBILITY_SYSTEM,
(1 << Pri_VISIBILITY_SYSTEM));
Pri_TIMELINE_ALLOWED_VIS);
/***** End table and box *****/
Box_EndBoxTable ();
@ -163,11 +165,11 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
/***** Form with list of options *****/
if (Action != ActUnk)
Frm_StartFormAnchor (Action,Pri_PRIVACY_ID);
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
fprintf (Gbl.F.Out,"<ul class=\"PRI_LIST LIST_LEFT\">");
for (Visibility = Pri_VISIBILITY_USER;
Visibility <= Pri_VISIBILITY_WORLD;
Visibility++)
if (MaskAllowedVisibility & 1 << Visibility)
if (MaskAllowedVisibility & (1 << Visibility))
{
fprintf (Gbl.F.Out,"<li class=\"%s\">"
"<label>"
@ -180,7 +182,7 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
if (Action == ActUnk)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
else
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\"",
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();\"",
Gbl.Form.Id);
fprintf (Gbl.F.Out," />"
"%s"

View File

@ -35,8 +35,25 @@
/*****************************************************************************/
/***** Visibility (who can see user's photo / public profile) *****/
#define Pri_PHOTO_VISIBILITY_DEFAULT Pri_VISIBILITY_SYSTEM
#define Pri_PROFILE_VISIBILITY_DEFAULT Pri_VISIBILITY_SYSTEM
/* Allowed visibility for photo */
#define Pri_PHOTO_ALLOWED_VIS (1 << Pri_VISIBILITY_USER) | \
(1 << Pri_VISIBILITY_COURSE) | \
(1 << Pri_VISIBILITY_SYSTEM) | \
(1 << Pri_VISIBILITY_WORLD)
/* Allowed visibility for basic profile */
#define Pri_BASIC_PROFILE_ALLOWED_VIS (1 << Pri_VISIBILITY_SYSTEM) | \
(1 << Pri_VISIBILITY_WORLD)
/* Allowed visibility for extended profile */
#define Pri_EXTENDED_PROFILE_ALLOWED_VIS (1 << Pri_VISIBILITY_USER) | \
(1 << Pri_VISIBILITY_COURSE) | \
(1 << Pri_VISIBILITY_SYSTEM) | \
(1 << Pri_VISIBILITY_WORLD)
/* Allowed visibility for timeline */
#define Pri_TIMELINE_ALLOWED_VIS (1 << Pri_VISIBILITY_SYSTEM)
#define Pri_PHOTO_VIS_DEFAULT Pri_VISIBILITY_SYSTEM
#define Pri_BASIC_PROFILE_VIS_DEFAULT Pri_VISIBILITY_SYSTEM
#define Pri_EXTENDED_PROFILE_VIS_DEFAULT Pri_VISIBILITY_SYSTEM
/*****************************************************************************/
/***************************** Public prototypes *****************************/

View File

@ -282,7 +282,7 @@ bool Prf_ShowUserProfile (struct UsrData *UsrDat)
bool ItsMe = Usr_ItsMe (UsrDat->UsrCod);
/***** Check if I can see the public profile *****/
if (Pri_ShowingIsAllowed (UsrDat->ProfileVisibility,UsrDat))
if (Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat))
{
/***** Contextual links *****/
if (Gbl.Usrs.Me.Logged)
@ -316,24 +316,28 @@ bool Prf_ShowUserProfile (struct UsrData *UsrDat)
}
Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_PUBLIC,UsrDat,NULL);
/***** Show details of user's profile *****/
Prf_ShowDetailsUserProfile (UsrDat);
/***** Extended profile *****/
if (Pri_ShowingIsAllowed (UsrDat->ExPrfVisibility,UsrDat))
{
/***** Show details of user's profile *****/
Prf_ShowDetailsUserProfile (UsrDat);
/***** Count following and followers *****/
Fol_GetNumFollow (UsrDat->UsrCod,&NumFollowing,&NumFollowers);
UsrFollowsMe = false;
if (NumFollowing)
UsrFollowsMe = Fol_CheckUsrIsFollowerOf (UsrDat->UsrCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
IFollowUsr = false;
if (NumFollowers)
IFollowUsr = Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,
UsrDat->UsrCod);
/***** Count following and followers *****/
Fol_GetNumFollow (UsrDat->UsrCod,&NumFollowing,&NumFollowers);
UsrFollowsMe = false;
if (NumFollowing)
UsrFollowsMe = Fol_CheckUsrIsFollowerOf (UsrDat->UsrCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
IFollowUsr = false;
if (NumFollowers)
IFollowUsr = Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,
UsrDat->UsrCod);
/***** Show following and followers *****/
Fol_ShowFollowingAndFollowers (UsrDat,
NumFollowing,NumFollowers,
UsrFollowsMe,IFollowUsr);
/***** Show following and followers *****/
Fol_ShowFollowingAndFollowers (UsrDat,
NumFollowing,NumFollowers,
UsrFollowsMe,IFollowUsr);
}
return true;
}
@ -344,19 +348,38 @@ bool Prf_ShowUserProfile (struct UsrData *UsrDat)
/******************** Change my public profile visibility ********************/
/*****************************************************************************/
void Prf_ChangeProfileVisibility (void)
void Prf_ChangeBasicProfileVis (void)
{
extern const char *Pri_VisibilityDB[Pri_NUM_OPTIONS_PRIVACY];
/***** Get param with public/private photo *****/
Gbl.Usrs.Me.UsrDat.ProfileVisibility = Pri_GetParamVisibility ("VisPrf");
Gbl.Usrs.Me.UsrDat.BaPrfVisibility = Pri_GetParamVisibility ("VisBasPrf");
/***** Store public/private photo in database *****/
DB_QueryUPDATE ("can not update your preference"
" about public profile visibility",
"UPDATE usr_data SET ProfileVisibility='%s'"
"UPDATE usr_data SET BaPrfVisibility='%s'"
" WHERE UsrCod=%ld",
Pri_VisibilityDB[Gbl.Usrs.Me.UsrDat.ProfileVisibility],
Pri_VisibilityDB[Gbl.Usrs.Me.UsrDat.BaPrfVisibility],
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Show form again *****/
Pre_EditPrefs ();
}
void Prf_ChangeExtendedProfileVis (void)
{
extern const char *Pri_VisibilityDB[Pri_NUM_OPTIONS_PRIVACY];
/***** Get param with public/private photo *****/
Gbl.Usrs.Me.UsrDat.ExPrfVisibility = Pri_GetParamVisibility ("VisExtPrf");
/***** Store public/private photo in database *****/
DB_QueryUPDATE ("can not update your preference"
" about public profile visibility",
"UPDATE usr_data SET ExPrfVisibility='%s'"
" WHERE UsrCod=%ld",
Pri_VisibilityDB[Gbl.Usrs.Me.UsrDat.ExPrfVisibility],
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Show form again *****/
@ -1732,7 +1755,7 @@ static void Prf_ShowUsrInRanking (struct UsrData *UsrDat,unsigned Rank)
extern const char *Txt_Another_user_s_profile;
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
bool Visible = Pri_ShowingIsAllowed (UsrDat->ProfileVisibility,UsrDat);
bool Visible = Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat);
fprintf (Gbl.F.Out,"<td class=\"RANK RIGHT_MIDDLE COLOR%u\""
" style=\"height:50px;\">"

View File

@ -60,7 +60,8 @@ void Prf_RequestUserProfile (void);
void Prf_GetUsrDatAndShowUserProfile (void);
bool Prf_ShowUserProfile (struct UsrData *UsrDat);
void Prf_ChangeProfileVisibility (void);
void Prf_ChangeBasicProfileVis (void);
void Prf_ChangeExtendedProfileVis (void);
void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat);
void Prf_GetUsrFigures (long UsrCod,struct UsrFigures *UsrFigures);

View File

@ -2474,7 +2474,7 @@ static void Rec_PutIconsCommands (void)
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB && // Only in main browser tab
Gbl.Usrs.Me.Logged) // Only if I am logged
{
ICanViewUsrProfile = Pri_ShowingIsAllowed (Gbl.Record.UsrDat->ProfileVisibility,
ICanViewUsrProfile = Pri_ShowingIsAllowed (Gbl.Record.UsrDat->BaPrfVisibility,
Gbl.Record.UsrDat);
/***** Start container *****/

View File

@ -2789,6 +2789,27 @@ const char *Txt_Banners =
"Banners";
#endif
const char *Txt_Basic_public_profile =
#if L==1 // ca
"Perfil p&uacute;blic b&agrave;sic";
#elif L==2 // de
"Grundlegendes &ouml;ffentliches Profile";
#elif L==3 // en
"Basic public profile";
#elif L==4 // es
"Perfil p&uacute;blico b&aacute;sico";
#elif L==5 // fr
"Profil public de base";
#elif L==6 // gn
"Perfil p&uacute;blico b&aacute;sico"; // Okoteve traducción
#elif L==7 // it
"Profilo pubblico di base";
#elif L==8 // pl
"Podstawowy profil publiczny";
#elif L==9 // pt
"Perfil p&uacute;blico b&aacute;sico";
#endif
const char *Txt_Before_creating_a_new_account_check_if_you_have_been_already_registered =
#if L==1 // ca
"Abans de crear un compte nou,"
@ -11321,6 +11342,27 @@ const char *Txt_Export_questions =
"Exportar perguntas";
#endif
const char *Txt_Extended_public_profile =
#if L==1 // ca
"Perfil p&uacute;blic ampliat";
#elif L==2 // de
"Erweitertes &ouml;ffentliches Profile";
#elif L==3 // en
"Extended public profile";
#elif L==4 // es
"Perfil p&uacute;blico extendido";
#elif L==5 // fr
"Profil public &eacute;tendu";
#elif L==6 // gn
"Perfil p&uacute;blico extendido"; // Okoteve traducción
#elif L==7 // it
"Profilo pubblico esteso";
#elif L==8 // pl
"Rozszerzony profil publiczny";
#elif L==9 // pt
"Perfil p&uacute;blico estendido";
#endif
const char *Txt_X_faces_have_been_detected_in_front_position_1_Z_ = // Warning: it is very important to include two %u in the following sentences
#if L==1 // ca
"Se han detectado %u rostros en posici&oacute;n frontal:<br />"
@ -30591,27 +30633,6 @@ const char *Txt_Public_open_educational_resource_OER_for_everyone =
"P&uacute;blico, recurso educacional aberto (OER) para todos";
#endif
const char *Txt_Public_profile =
#if L==1 // ca
"Perfil p&uacute;blic";
#elif L==2 // de
"&Ouml;ffentliches Benutzer-Profile";
#elif L==3 // en
"Public profile";
#elif L==4 // es
"Perfil p&uacute;blico";
#elif L==5 // fr
"Profil public";
#elif L==6 // gn
"Perfil p&uacute;blico"; // Okoteve traducción
#elif L==7 // it
"Profilo pubblico";
#elif L==8 // pl
"Profil publiczny";
#elif L==9 // pt
"Perfil p&uacute;blico";
#endif
const char *Txt_Public_views =
#if L==1 // ca
"Accessos p&uacute;blics";

View File

@ -323,8 +323,9 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
UsrDat->EmailConfirmed = false;
UsrDat->Photo[0] = '\0';
UsrDat->PhotoVisibility = Pri_PHOTO_VISIBILITY_DEFAULT;
UsrDat->ProfileVisibility = Pri_PROFILE_VISIBILITY_DEFAULT;
UsrDat->PhotoVisibility = Pri_PHOTO_VIS_DEFAULT;
UsrDat->BaPrfVisibility = Pri_BASIC_PROFILE_VIS_DEFAULT;
UsrDat->ExPrfVisibility = Pri_EXTENDED_PROFILE_VIS_DEFAULT;
UsrDat->CtyCod = -1L;
UsrDat->OriginPlace[0] = '\0';
@ -494,24 +495,25 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
"Sex," // row[ 5]
"Photo," // row[ 6]
"PhotoVisibility," // row[ 7]
"ProfileVisibility," // row[ 8]
"CtyCod," // row[ 9]
"InsCtyCod," // row[10]
"InsCod," // row[11]
"DptCod," // row[12]
"CtrCod," // row[13]
"Office," // row[14]
"OfficePhone," // row[15]
"LocalAddress," // row[16]
"LocalPhone," // row[17]
"FamilyAddress," // row[18]
"FamilyPhone," // row[19]
"OriginPlace," // row[20]
"BaPrfVisibility," // row[ 8]
"ExPrfVisibility," // row[ 9]
"CtyCod," // row[10]
"InsCtyCod," // row[11]
"InsCod," // row[12]
"DptCod," // row[13]
"CtrCod," // row[14]
"Office," // row[15]
"OfficePhone," // row[16]
"LocalAddress," // row[17]
"LocalPhone," // row[18]
"FamilyAddress," // row[19]
"FamilyPhone," // row[20]
"OriginPlace," // row[21]
"DATE_FORMAT(Birthday,"
"'%%Y%%m%%d')," // row[21]
"Comments," // row[22]
"NotifNtfEvents," // row[23]
"EmailNtfEvents" // row[24]
"'%%Y%%m%%d')," // row[22]
"Comments," // row[23]
"NotifNtfEvents," // row[24]
"EmailNtfEvents" // row[25]
" FROM usr_data"
" WHERE UsrCod=%ld",
UsrDat->UsrCod);
@ -527,35 +529,36 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
"Sex," // row[ 5]
"Photo," // row[ 6]
"PhotoVisibility," // row[ 7]
"ProfileVisibility," // row[ 8]
"CtyCod," // row[ 9]
"InsCtyCod," // row[10]
"InsCod," // row[11]
"DptCod," // row[12]
"CtrCod," // row[13]
"Office," // row[14]
"OfficePhone," // row[15]
"LocalAddress," // row[16]
"LocalPhone," // row[17]
"FamilyAddress," // row[18]
"FamilyPhone," // row[19]
"OriginPlace," // row[20]
"BaPrfVisibility," // row[ 8]
"ExPrfVisibility," // row[ 9]
"CtyCod," // row[10]
"InsCtyCod," // row[11]
"InsCod," // row[12]
"DptCod," // row[13]
"CtrCod," // row[14]
"Office," // row[15]
"OfficePhone," // row[16]
"LocalAddress," // row[17]
"LocalPhone," // row[18]
"FamilyAddress," // row[19]
"FamilyPhone," // row[20]
"OriginPlace," // row[21]
"DATE_FORMAT(Birthday,"
"'%%Y%%m%%d')," // row[21]
"Comments," // row[22]
"NotifNtfEvents," // row[23]
"EmailNtfEvents," // row[24]
"'%%Y%%m%%d')," // row[22]
"Comments," // row[23]
"NotifNtfEvents," // row[24]
"EmailNtfEvents," // row[25]
// Preferences (usually not necessary
// when getting another user's data)
"Language," // row[25]
"FirstDayOfWeek," // row[26]
"DateFormat," // row[27]
"Theme," // row[28]
"IconSet," // row[29]
"Menu," // row[30]
"SideCols," // row[31]
"ThirdPartyCookies" // row[32]
"Language," // row[26]
"FirstDayOfWeek," // row[27]
"DateFormat," // row[28]
"Theme," // row[29]
"IconSet," // row[30]
"Menu," // row[31]
"SideCols," // row[32]
"ThirdPartyCookies" // row[33]
" FROM usr_data"
" WHERE UsrCod=%ld",
UsrDat->UsrCod);
@ -605,59 +608,60 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
/* Get photo visibility (row[7]) */
UsrDat->PhotoVisibility = Pri_GetVisibilityFromStr (row[7]);
/* Get profile visibility (row[8]) */
UsrDat->ProfileVisibility = Pri_GetVisibilityFromStr (row[8]);
/* Get profile visibility (row[8], row[9]) */
UsrDat->BaPrfVisibility = Pri_GetVisibilityFromStr (row[8]);
UsrDat->ExPrfVisibility = Pri_GetVisibilityFromStr (row[9]);
/* Get country (row[9]) */
UsrDat->CtyCod = Str_ConvertStrCodToLongCod (row[9]);
/* Get country (row[10]) */
UsrDat->CtyCod = Str_ConvertStrCodToLongCod (row[10]);
/* Get institution country (row[10]) and institution (row[11]) */
UsrDat->InsCtyCod = Str_ConvertStrCodToLongCod (row[10]);
UsrDat->InsCod = Str_ConvertStrCodToLongCod (row[11]);
/* Get institution country (row[11]) and institution (row[12]) */
UsrDat->InsCtyCod = Str_ConvertStrCodToLongCod (row[11]);
UsrDat->InsCod = Str_ConvertStrCodToLongCod (row[12]);
/* Get department (row[12]) */
UsrDat->Tch.DptCod = Str_ConvertStrCodToLongCod (row[12]);
/* Get department (row[13]) */
UsrDat->Tch.DptCod = Str_ConvertStrCodToLongCod (row[13]);
/* Get centre (row[13]) */
UsrDat->Tch.CtrCod = Str_ConvertStrCodToLongCod (row[13]);
/* Get centre (row[14]) */
UsrDat->Tch.CtrCod = Str_ConvertStrCodToLongCod (row[14]);
/* Get office (row[14]) and office phone (row[15]) */
Str_Copy (UsrDat->Tch.Office,row[14],
/* Get office (row[15]) and office phone (row[16]) */
Str_Copy (UsrDat->Tch.Office,row[15],
Usr_MAX_BYTES_ADDRESS);
Str_Copy (UsrDat->Tch.OfficePhone,row[15],
Str_Copy (UsrDat->Tch.OfficePhone,row[16],
Usr_MAX_BYTES_PHONE);
/* Get local address (row[16]) and local phone (row[17]) */
Str_Copy (UsrDat->LocalAddress,row[16],
/* Get local address (row[17]) and local phone (row[18]) */
Str_Copy (UsrDat->LocalAddress,row[17],
Usr_MAX_BYTES_ADDRESS);
Str_Copy (UsrDat->LocalPhone,row[17],
Str_Copy (UsrDat->LocalPhone,row[18],
Usr_MAX_BYTES_PHONE);
/* Get local address (row[18]) and local phone (row[19]) */
Str_Copy (UsrDat->FamilyAddress,row[18],
/* Get local address (row[19]) and local phone (row[20]) */
Str_Copy (UsrDat->FamilyAddress,row[19],
Usr_MAX_BYTES_ADDRESS);
Str_Copy (UsrDat->FamilyPhone,row[19],
Str_Copy (UsrDat->FamilyPhone,row[20],
Usr_MAX_BYTES_PHONE);
/* Get origin place (row[20]) */
Str_Copy (UsrDat->OriginPlace,row[20],
/* Get origin place (row[21]) */
Str_Copy (UsrDat->OriginPlace,row[21],
Usr_MAX_BYTES_ADDRESS);
/* Get birthday (row[21]) */
Dat_GetDateFromYYYYMMDD (&(UsrDat->Birthday),row[21]);
/* Get birthday (row[22]) */
Dat_GetDateFromYYYYMMDD (&(UsrDat->Birthday),row[22]);
Dat_ConvDateToDateStr (&(UsrDat->Birthday),UsrDat->StrBirthday);
/* Get comments (row[22]) */
Usr_GetUsrCommentsFromString (row[22] ? row[22] :
/* Get comments (row[23]) */
Usr_GetUsrCommentsFromString (row[23] ? row[23] :
"",
UsrDat);
/* Get on which events the user wants to be notified inside the platform (row[23]) */
if (sscanf (row[23],"%u",&UsrDat->NtfEvents.CreateNotif) != 1)
/* Get on which events the user wants to be notified inside the platform (row[24]) */
if (sscanf (row[24],"%u",&UsrDat->NtfEvents.CreateNotif) != 1)
UsrDat->NtfEvents.CreateNotif = (unsigned) -1; // 0xFF..FF
/* Get on which events the user wants to be notified by email (row[24]) */
if (sscanf (row[24],"%u",&UsrDat->NtfEvents.SendEmail) != 1)
/* Get on which events the user wants to be notified by email (row[25]) */
if (sscanf (row[25],"%u",&UsrDat->NtfEvents.SendEmail) != 1)
UsrDat->NtfEvents.SendEmail = 0;
if (UsrDat->NtfEvents.SendEmail >= (1 << Ntf_NUM_NOTIFY_EVENTS)) // Maximum binary value for NotifyEvents is 000...0011...11
UsrDat->NtfEvents.SendEmail = 0;
@ -665,50 +669,50 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
/***** Get user's preferences *****/
if (GetPrefs == Usr_GET_PREFS)
{
/* Get language (row[25]) */
/* Get language (row[26]) */
UsrDat->Prefs.Language = Lan_LANGUAGE_UNKNOWN; // Language unknown
for (Lan = (Lan_Language_t) 1;
Lan <= Lan_NUM_LANGUAGES;
Lan++)
if (!strcasecmp (row[25],Lan_STR_LANG_ID[Lan]))
if (!strcasecmp (row[26],Lan_STR_LANG_ID[Lan]))
{
UsrDat->Prefs.Language = Lan;
break;
}
/* Get first day of week (row[26]) */
UsrDat->Prefs.FirstDayOfWeek = Cal_GetFirstDayOfWeekFromStr (row[26]);
/* Get first day of week (row[27]) */
UsrDat->Prefs.FirstDayOfWeek = Cal_GetFirstDayOfWeekFromStr (row[27]);
/* Get date format (row[27]) */
UsrDat->Prefs.DateFormat = Dat_GetDateFormatFromStr (row[27]);
/* Get date format (row[28]) */
UsrDat->Prefs.DateFormat = Dat_GetDateFormatFromStr (row[28]);
/* Get theme (row[28]) */
/* Get theme (row[29]) */
UsrDat->Prefs.Theme = The_THEME_DEFAULT;
for (Theme = (The_Theme_t) 0;
Theme < The_NUM_THEMES;
Theme++)
if (!strcasecmp (row[28],The_ThemeId[Theme]))
if (!strcasecmp (row[29],The_ThemeId[Theme]))
{
UsrDat->Prefs.Theme = Theme;
break;
}
/* Get icon set (row[29]) */
/* Get icon set (row[30]) */
UsrDat->Prefs.IconSet = Ico_ICON_SET_DEFAULT;
for (IconSet = (Ico_IconSet_t) 0;
IconSet < Ico_NUM_ICON_SETS;
IconSet++)
if (!strcasecmp (row[29],Ico_IconSetId[IconSet]))
if (!strcasecmp (row[30],Ico_IconSetId[IconSet]))
{
UsrDat->Prefs.IconSet = IconSet;
break;
}
/* Get menu (row[30]) */
UsrDat->Prefs.Menu = Mnu_GetMenuFromStr (row[28]);
/* Get menu (row[31]) */
UsrDat->Prefs.Menu = Mnu_GetMenuFromStr (row[31]);
/* Get if user wants to show side columns (row[31]) */
if (sscanf (row[29],"%u",&UsrDat->Prefs.SideCols) == 1)
/* Get if user wants to show side columns (row[32]) */
if (sscanf (row[32],"%u",&UsrDat->Prefs.SideCols) == 1)
{
if (UsrDat->Prefs.SideCols > Lay_SHOW_BOTH_COLUMNS)
UsrDat->Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
@ -716,8 +720,8 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
else
UsrDat->Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
/* Get if user accepts third party cookies (row[32]) */
UsrDat->Prefs.AcceptThirdPartyCookies = (row[32][0] == 'Y');
/* Get if user accepts third party cookies (row[33]) */
UsrDat->Prefs.AcceptThirdPartyCookies = (row[33][0] == 'Y');
}
/***** Free structure that stores the query result *****/

View File

@ -171,7 +171,8 @@ struct UsrData
bool EmailConfirmed;
char Photo [Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1]; // Name of public link to photo
Pri_Visibility_t PhotoVisibility; // Who can see user's photo
Pri_Visibility_t ProfileVisibility; // Who can see user's public profile
Pri_Visibility_t BaPrfVisibility; // Who can see user's basic public profile (minimal record card)
Pri_Visibility_t ExPrfVisibility; // Who can see user's extended public profile (figures, follow)
long CtyCod; // Country
char OriginPlace [Usr_MAX_BYTES_ADDRESS + 1];
struct Date Birthday;