From 3ad087f987b1364217eb2a4ce04168fc00c47ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 22 Mar 2019 15:21:46 +0100 Subject: [PATCH] Version18.86 --- css/swad18.85.1.css | 7 ++ sql/cambios.sql | 3 +- sql/swad.sql | 6 +- swad_account.c | 7 +- swad_action.c | 14 ++-- swad_action.h | 21 ++--- swad_agenda.c | 2 +- swad_changelog.h | 12 ++- swad_database.c | 11 ++- swad_figure.c | 18 +++-- swad_follow.c | 12 +-- swad_media.c | 2 +- swad_privacy.c | 40 +++++----- swad_privacy.h | 21 ++++- swad_profile.c | 67 ++++++++++------ swad_profile.h | 3 +- swad_record.c | 2 +- swad_text.c | 63 ++++++++++----- swad_user.c | 184 ++++++++++++++++++++++---------------------- swad_user.h | 3 +- 20 files changed, 301 insertions(+), 197 deletions(-) diff --git a/css/swad18.85.1.css b/css/swad18.85.1.css index 79c453d0..44883d17 100644 --- a/css/swad18.85.1.css +++ b/css/swad18.85.1.css @@ -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) diff --git a/sql/cambios.sql b/sql/cambios.sql index 4e0caebd..30d7e9ee 100644 --- a/sql/cambios.sql +++ b/sql/cambios.sql @@ -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; \ No newline at end of file diff --git a/sql/swad.sql b/sql/swad.sql index 9f1b1c5c..4a56b13d 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -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), diff --git a/swad_account.c b/swad_account.c index 3f4f0bf9..c6399665 100644 --- a/swad_account.c +++ b/swad_account.c @@ -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, diff --git a/swad_action.c b/swad_action.c index 4a313ea5..ba1a46cd 100644 --- a/swad_action.c +++ b/swad_action.c @@ -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 (); diff --git a/swad_action.h b/swad_action.h index 29a92d0b..e0452046 100644 --- a/swad_action.h +++ b/swad_action.h @@ -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 *******************************/ diff --git a/swad_agenda.c b/swad_agenda.c index 3421668d..f10c2924 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -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, diff --git a/swad_changelog.h b/swad_changelog.h index fd47bbaa..e76cee8c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -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. diff --git a/swad_database.c b/swad_database.c index 8a2c72e6..550a8ecb 100644 --- a/swad_database.c +++ b/swad_database.c @@ -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)," diff --git a/swad_figure.c b/swad_figure.c index 2c0d872a..0215fc59 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -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; diff --git a/swad_follow.c b/swad_follow.c index 84114a12..0323f065 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -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 *****/ diff --git a/swad_media.c b/swad_media.c index 603264d8..a8c10bf8 100644 --- a/swad_media.c +++ b/swad_media.c @@ -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 diff --git a/swad_privacy.c b/swad_privacy.c index f44b01b2..36a1dc18 100644 --- a/swad_privacy.c +++ b/swad_privacy.c @@ -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,"