diff --git a/swad_account.c b/swad_account.c
index 42b067017..f67b7e99c 100644
--- a/swad_account.c
+++ b/swad_account.c
@@ -412,7 +412,7 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat)
{
extern const char *The_ThemeId[The_NUM_THEMES];
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
- extern const char *Pho_VisibilityDB[Pho_NUM_VISIBILITIES];
+ extern const char *Pri_VISIBILITYDB[Pri_NUM_OPTIONS_PRIVACY];
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
extern const char *Usr_StringsSexDB[Usr_NUM_SEXS];
char Query[2048];
@@ -449,7 +449,7 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat)
The_ThemeId[UsrDat->Prefs.Theme],
Ico_IconSetId[UsrDat->Prefs.IconSet],
Txt_STR_LANG_ID[UsrDat->Prefs.Language],
- Pho_VisibilityDB[UsrDat->PhotoVisibility],
+ Pri_VISIBILITYDB[UsrDat->PhotoVisibility],
UsrDat->CtyCod,
UsrDat->LocalAddress ,UsrDat->LocalPhone,
UsrDat->FamilyAddress,UsrDat->FamilyPhone,
diff --git a/swad_changelog.h b/swad_changelog.h
index 51b61e034..ae589f8c6 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -103,11 +103,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 14.78.2 (2015/03/06)"
+#define Log_PLATFORM_VERSION "SWAD 14.78.3 (2015/03/06)"
// 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 | tail -1
/*
+ Version 14.78.3: Mar 06, 2015 Changes in messages about privacity. (178631 lines)
Version 14.78.2: Mar 06, 2015 New action to edit privacy options. (178630 lines)
Version 14.78.1: Mar 06, 2015 New link to privacy options (unfinished). (178595 lines)
Version 14.78: Mar 06, 2015 Four degrees of visibility in photos.
diff --git a/swad_enrollment.c b/swad_enrollment.c
index 267fd5859..0b24d70ee 100644
--- a/swad_enrollment.c
+++ b/swad_enrollment.c
@@ -372,7 +372,7 @@ void Enr_UpdateUsrData (struct UsrData *UsrDat)
{
extern const char *The_ThemeId[The_NUM_THEMES];
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
- extern const char *Pho_VisibilityDB[Pho_NUM_VISIBILITIES];
+ extern const char *Pri_VISIBILITYDB[Pri_NUM_OPTIONS_PRIVACY];
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
extern const char *Usr_StringsSexDB[Usr_NUM_SEXS];
char Query[2048];
@@ -399,7 +399,7 @@ void Enr_UpdateUsrData (struct UsrData *UsrDat)
The_ThemeId[UsrDat->Prefs.Theme],
Ico_IconSetId[UsrDat->Prefs.IconSet],
Txt_STR_LANG_ID[UsrDat->Prefs.Language],
- Pho_VisibilityDB[UsrDat->PhotoVisibility],
+ Pri_VISIBILITYDB[UsrDat->PhotoVisibility],
UsrDat->CtyCod,
UsrDat->LocalAddress,UsrDat->LocalPhone,
UsrDat->FamilyAddress,UsrDat->FamilyPhone,UsrDat->OriginPlace,
diff --git a/swad_photo.c b/swad_photo.c
index 27b7927f5..9be530720 100644
--- a/swad_photo.c
+++ b/swad_photo.c
@@ -43,7 +43,7 @@
#include "swad_logo.h"
#include "swad_parameter.h"
#include "swad_photo.h"
-#include "swad_photo_visibility.h"
+#include "swad_privacy.h"
#include "swad_theme.h"
#include "swad_user.h"
@@ -58,12 +58,12 @@ extern struct Globals Gbl;
/*****************************************************************************/
/***** Photo visibility (who can see user's photo) *****/
-const char *Pho_VisibilityDB[Pho_NUM_VISIBILITIES] =
+const char *Pri_VISIBILITYDB[Pri_NUM_OPTIONS_PRIVACY] =
{
- "user", // Pho_VISIBILITY_USER
- "course", // Pho_VISIBILITY_COURSE
- "system", // Pho_VISIBILITY_SYSTEM
- "world", // Pho_VISIBILITY_WORLD
+ "user", // Pri_VISIBILITY_USER
+ "course", // Pri_VISIBILITY_COURSE
+ "system", // Pri_VISIBILITY_SYSTEM
+ "world", // Pri_VISIBILITY_WORLD
};
/*****************************************************************************/
@@ -791,20 +791,20 @@ bool Pho_ShowUsrPhotoIsAllowed (struct UsrData *UsrDat,char *PhotoURL)
/***** Check if I can see the other's photo *****/
switch (UsrDat->PhotoVisibility)
{
- case Pho_VISIBILITY_USER: // Only visible by me and my teachers if I am a student or me and my students if I am a teacher
+ case Pri_VISIBILITY_USER: // Only visible by me and my teachers if I am a student or me and my students if I am a teacher
if (ItsMe || // I always can see my photo
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM) // A system admin always can see any user's photo
ICanSeePhoto = true;
else
ICanSeePhoto = Usr_CheckIfUsrSharesAnyOfMyCrsWithDifferentRole (UsrDat->UsrCod); // Both users share the same course but whit different role
break;
- case Pho_VISIBILITY_COURSE: // Visible by users sharing courses with me
+ case Pri_VISIBILITY_COURSE: // Visible by users sharing courses with me
ICanSeePhoto = Usr_CheckIfUsrSharesAnyOfMyCrs (UsrDat->UsrCod); // Both users share the same course
break;
- case Pho_VISIBILITY_SYSTEM: // Visible by any user logged in platform
+ case Pri_VISIBILITY_SYSTEM: // Visible by any user logged in platform
ICanSeePhoto = Gbl.Usrs.Me.Logged;
break;
- case Pho_VISIBILITY_WORLD: // Public, visible by all the people, even unlogged visitors
+ case Pri_VISIBILITY_WORLD: // Public, visible by all the people, even unlogged visitors
ICanSeePhoto = true;
break;
}
@@ -1026,8 +1026,8 @@ void Pho_PutFormPhotoVisibility (void)
{
extern const char *The_ClassFormul[The_NUM_THEMES];
extern const char *Txt_Photo;
- extern const char *Txt_PHOTO_VISIBILITY[Pho_NUM_VISIBILITIES];
- Pho_Visibility_t PhotoVisibility;
+ extern const char *Txt_PRIVACY_OPTIONS[Pri_NUM_OPTIONS_PRIVACY];
+ Pri_VISIBILITY_t PhotoVisibility;
/***** Select photo visibility *****/
fprintf (Gbl.F.Out,"
"
@@ -1042,8 +1042,8 @@ void Pho_PutFormPhotoVisibility (void)
Act_FormStart (ActChgPubPho);
fprintf (Gbl.F.Out,"");
- for (PhotoVisibility = (Pho_Visibility_t) 0;
- PhotoVisibility < Pho_NUM_VISIBILITIES;
+ for (PhotoVisibility = (Pri_VISIBILITY_t) 0;
+ PhotoVisibility < Pri_NUM_OPTIONS_PRIVACY;
PhotoVisibility++)
{
fprintf (Gbl.F.Out,"- "
@@ -1054,7 +1054,7 @@ void Pho_PutFormPhotoVisibility (void)
fprintf (Gbl.F.Out," onclick=\"javascript:document.getElementById('%s').submit();\" />"
"%s"
"
",
- Gbl.FormId,Txt_PHOTO_VISIBILITY[PhotoVisibility]);
+ Gbl.FormId,Txt_PRIVACY_OPTIONS[PhotoVisibility]);
}
/***** End of list and form *****/
@@ -1068,17 +1068,17 @@ void Pho_PutFormPhotoVisibility (void)
/************************* Get icon set from string **************************/
/*****************************************************************************/
-Pho_Visibility_t Pho_GetPhotoVisibilityFromStr (const char *Str)
+Pri_VISIBILITY_t Pho_GetPhotoVisibilityFromStr (const char *Str)
{
- Pho_Visibility_t PhotoVisibility;
+ Pri_VISIBILITY_t PhotoVisibility;
- for (PhotoVisibility = (Pho_Visibility_t) 0;
- PhotoVisibility < Pho_NUM_VISIBILITIES;
+ for (PhotoVisibility = (Pri_VISIBILITY_t) 0;
+ PhotoVisibility < Pri_NUM_OPTIONS_PRIVACY;
PhotoVisibility++)
- if (!strcasecmp (Str,Pho_VisibilityDB[PhotoVisibility]))
+ if (!strcasecmp (Str,Pri_VISIBILITYDB[PhotoVisibility]))
return PhotoVisibility;
- return Pho_VISIBILITY_DEFAULT;
+ return Pri_VISIBILITY_DEFAULT;
}
/*****************************************************************************/
@@ -1095,11 +1095,11 @@ bool Pho_GetParamPhotoVisibility (void)
{
if (sscanf (UnsignedStr,"%u",&UnsignedNum) != 1)
Lay_ShowErrorAndExit ("Photo visibility is missing.");
- if (UnsignedNum >= Pho_NUM_VISIBILITIES)
+ if (UnsignedNum >= Pri_NUM_OPTIONS_PRIVACY)
Lay_ShowErrorAndExit ("Photo visibility is missing.");
- return (Pho_Visibility_t) UnsignedNum;
+ return (Pri_VISIBILITY_t) UnsignedNum;
}
- return Pho_VISIBILITY_DEFAULT;
+ return Pri_VISIBILITY_DEFAULT;
}
/*****************************************************************************/
@@ -1117,7 +1117,7 @@ void Pho_ChangePhotoVisibility (void)
/***** Store public/private photo in database *****/
sprintf (Query,"UPDATE usr_data SET PhotoVisibility='%s'"
" WHERE UsrCod='%ld'",
- Pho_VisibilityDB[Gbl.Usrs.Me.UsrDat.PhotoVisibility],
+ Pri_VISIBILITYDB[Gbl.Usrs.Me.UsrDat.PhotoVisibility],
Gbl.Usrs.Me.UsrDat.UsrCod);
DB_QueryUPDATE (Query,"can not update your preference about photo visibility");
diff --git a/swad_photo.h b/swad_photo.h
index f12cf5ffd..f8315c19c 100644
--- a/swad_photo.h
+++ b/swad_photo.h
@@ -102,7 +102,7 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
const char *ClassPhoto,bool Zoom);
void Pho_PutFormPhotoVisibility (void);
-Pho_Visibility_t Pho_GetPhotoVisibilityFromStr (const char *Str);
+Pri_VISIBILITY_t Pho_GetPhotoVisibilityFromStr (const char *Str);
bool Pho_GetParamPhotoVisibility (void);
void Pho_ChangePhotoVisibility (void);
diff --git a/swad_photo_visibility.h b/swad_privacy.h
similarity index 77%
rename from swad_photo_visibility.h
rename to swad_privacy.h
index af931daba..4b9e451db 100644
--- a/swad_photo_visibility.h
+++ b/swad_privacy.h
@@ -1,7 +1,7 @@
-// swad_photo_visibility.h: Users' photo visibility
+// swad_privacy.h: Users' photo and public profile visibility
-#ifndef _SWAD_PHO_VISIBILITY
-#define _SWAD_PHO_VISIBILITY
+#ifndef _SWAD_PRI
+#define _SWAD_PRI
/*
SWAD (Shared Workspace At a Distance in Spanish),
is a web platform developed at the University of Granada (Spain),
@@ -31,18 +31,18 @@
/************************* Public types and constants ************************/
/*****************************************************************************/
-/***** Photo visibility (who can see user's photo) *****/
-#define Pho_NUM_VISIBILITIES 4
+/***** Visibility (who can see user's photo / public profile) *****/
+#define Pri_NUM_OPTIONS_PRIVACY 4
typedef enum
{
- Pho_VISIBILITY_USER = 0, // Only visible by me and my teachers if I am a student or my students if I am a teacher
- Pho_VISIBILITY_COURSE = 1, // Visible by users sharing courses with me
- Pho_VISIBILITY_SYSTEM = 2, // Visible by any user logged in platform
- Pho_VISIBILITY_WORLD = 3, // Public, visible by all the people, even unlogged visitors
- } Pho_Visibility_t;
+ Pri_VISIBILITY_USER = 0, // Only visible by me and my teachers if I am a student or my students if I am a teacher
+ Pri_VISIBILITY_COURSE = 1, // Visible by users sharing courses with me
+ Pri_VISIBILITY_SYSTEM = 2, // Visible by any user logged in platform
+ Pri_VISIBILITY_WORLD = 3, // Public, visible by all the people, even unlogged visitors
+ } Pri_VISIBILITY_t;
-#define Pho_VISIBILITY_DEFAULT Pho_VISIBILITY_USER
+#define Pri_VISIBILITY_DEFAULT Pri_VISIBILITY_USER
/*****************************************************************************/
/***************************** Public prototypes *****************************/
diff --git a/swad_text.c b/swad_text.c
index 85b7d190d..50f4566a6 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -26240,89 +26240,6 @@ const char *Txt_Photo_removed =
"Photo removed."; // Necessita de tradução
#endif
-const char *Txt_PHOTO_VISIBILITY[Pho_NUM_VISIBILITIES] =
- { // Pho_VISIBILITY_USER
-#if L==0
- "Foto visible por mí y mis profesores / mis estudiantes" // Necessita traduccio
-#elif L==1
- "Photo visible by me and my teachers / my students" // Need Übersetzung
-#elif L==2
- "Photo visible by me and my teachers / my students"
-#elif L==3
- "Foto visible por mí y mis profesores / mis estudiantes"
-#elif L==4
- "Photo visible by me and my teachers / my students" // Besoin de traduction
-#elif L==5
- "Foto visible por mí y mis profesores / mis estudiantes" // Okoteve traducción
-#elif L==6
- "Photo visible by me and my teachers / my students" // Bisogno di traduzione
-#elif L==7
- "Photo visible by me and my teachers / my students" // Potrzebujesz tlumaczenie
-#elif L==8
- "Photo visible by me and my teachers / my students" // Necessita de tradução
-#endif
- , // Pho_VISIBILITY_COURSE
-#if L==0
- "Foto visible por usuarios de mis asignaturas" // Necessita traduccio
-#elif L==1
- "Photo visible by users in my courses" // Need Übersetzung
-#elif L==2
- "Photo visible by users in my courses"
-#elif L==3
- "Foto visible por usuarios de mis asignaturas"
-#elif L==4
- "Photo visible by users in my courses" // Besoin de traduction
-#elif L==5
- "Foto visible por usuarios de mis asignaturas" // Okoteve traducción
-#elif L==6
- "Photo visible by users in my courses" // Bisogno di traduzione
-#elif L==7
- "Photo visible by users in my courses" // Potrzebujesz tlumaczenie
-#elif L==8
- "Photo visible by users in my courses" // Necessita de tradução
-#endif
- , // Pho_VISIBILITY_SYSTEM
-#if L==0
- "Foto visible por cualquier usuario identificado" // Necessita traduccio
-#elif L==1
- "Photo visible by any logged user" // Need Übersetzung
-#elif L==2
- "Photo visible by any logged user"
-#elif L==3
- "Foto visible por cualquier usuario identificado"
-#elif L==4
- "Photo visible by any logged user" // Besoin de traduction
-#elif L==5
- "Foto visible por cualquier usuario identificado" // Okoteve traducción
-#elif L==6
- "Photo visible by any logged user" // Bisogno di traduzione
-#elif L==7
- "Photo visible by any logged user" // Potrzebujesz tlumaczenie
-#elif L==8
- "Photo visible by any logged user" // Necessita de tradução
-#endif
- , // Pho_VISIBILITY_WORLD
-#if L==0
- "Foto pública, visible por todo el mundo" // Necessita traduccio
-#elif L==1
- "Public photo, visible by everyone" // Need Übersetzung
-#elif L==2
- "Public photo, visible by everyone"
-#elif L==3
- "Foto pública, visible por todo el mundo"
-#elif L==4
- "Public photo, visible by everyone" // Besoin de traduction
-#elif L==5
- "Foto pública, visible por todo el mundo" // Okoteve traducción
-#elif L==6
- "Public photo, visible by everyone" // Bisogno di traduzione
-#elif L==7
- "Public photo, visible by everyone" // Potrzebujesz tlumaczenie
-#elif L==8
- "Public photo, visible by everyone" // Necessita de tradução
-#endif
- };
-
const char *Txt_photos =
#if L==0
"fotos";
@@ -26922,6 +26839,90 @@ const char *Txt_Privacy =
"Privacidade";
#endif
+
+const char *Txt_PRIVACY_OPTIONS[Pri_NUM_OPTIONS_PRIVACY] =
+ { // Pri_VISIBILITY_USER
+#if L==0
+ "Visible por mí y mis profesores / mis estudiantes" // Necessita traduccio
+#elif L==1
+ "Visible by me and my teachers / my students" // Need Übersetzung
+#elif L==2
+ "Visible by me and my teachers / my students"
+#elif L==3
+ "Visible por mí y mis profesores / mis estudiantes"
+#elif L==4
+ "Visible by me and my teachers / my students" // Besoin de traduction
+#elif L==5
+ "Visible por mí y mis profesores / mis estudiantes" // Okoteve traducción
+#elif L==6
+ "Visible by me and my teachers / my students" // Bisogno di traduzione
+#elif L==7
+ "Visible by me and my teachers / my students" // Potrzebujesz tlumaczenie
+#elif L==8
+ "Visible by me and my teachers / my students" // Necessita de tradução
+#endif
+ , // Pri_VISIBILITY_COURSE
+#if L==0
+ "Visible por usuarios con los que comparto asignaturas" // Necessita traduccio
+#elif L==1
+ "Visible by users with whom I share courses" // Need Übersetzung
+#elif L==2
+ "Visible by users with whom I share courses"
+#elif L==3
+ "Visible por usuarios con los que comparto asignaturas"
+#elif L==4
+ "Visible by users with whom I share courses" // Besoin de traduction
+#elif L==5
+ "Visible por usuarios con los que comparto asignaturas" // Okoteve traducción
+#elif L==6
+ "Visible by users with whom I share courses" // Bisogno di traduzione
+#elif L==7
+ "Visible by users with whom I share courses" // Potrzebujesz tlumaczenie
+#elif L==8
+ "Visible by users with whom I share courses" // Necessita de tradução
+#endif
+ , // Pri_VISIBILITY_SYSTEM
+#if L==0
+ "Visible por cualquier usuario identificado" // Necessita traduccio
+#elif L==1
+ "Visible by any logged user" // Need Übersetzung
+#elif L==2
+ "Visible by any logged user"
+#elif L==3
+ "Visible por cualquier usuario identificado"
+#elif L==4
+ "Visible by any logged user" // Besoin de traduction
+#elif L==5
+ "Visible por cualquier usuario identificado" // Okoteve traducción
+#elif L==6
+ "Visible by any logged user" // Bisogno di traduzione
+#elif L==7
+ "Visible by any logged user" // Potrzebujesz tlumaczenie
+#elif L==8
+ "Visible by any logged user" // Necessita de tradução
+#endif
+ , // Pri_VISIBILITY_WORLD
+#if L==0
+ "Visible por todo el mundo" // Necessita traduccio
+#elif L==1
+ "Visible by everyone" // Need Übersetzung
+#elif L==2
+ "Visible by everyone"
+#elif L==3
+ "Visible por todo el mundo"
+#elif L==4
+ "Visible by everyone" // Besoin de traduction
+#elif L==5
+ "Visible por todo el mundo" // Okoteve traducción
+#elif L==6
+ "Visible by everyone" // Bisogno di traduzione
+#elif L==7
+ "Visible by everyone" // Potrzebujesz tlumaczenie
+#elif L==8
+ "Visible by everyone" // Necessita de tradução
+#endif
+ };
+
const char *Txt_Private_available_to_certain_users_identified =
#if L==0
"Privat, disponible per a certs usuaris identificats";
diff --git a/swad_user.c b/swad_user.c
index 13f46e152..ad131a538 100644
--- a/swad_user.c
+++ b/swad_user.c
@@ -238,7 +238,7 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
UsrDat->EmailConfirmed = false;
UsrDat->Photo[0] = '\0';
- UsrDat->PhotoVisibility = Pho_VISIBILITY_DEFAULT;
+ UsrDat->PhotoVisibility = Pri_VISIBILITY_DEFAULT;
UsrDat->CtyCod = -1L;
UsrDat->OriginPlace[0] = '\0';
diff --git a/swad_user.h b/swad_user.h
index c314d80a3..6700b9cee 100644
--- a/swad_user.h
+++ b/swad_user.h
@@ -38,7 +38,7 @@
#include "swad_layout.h"
#include "swad_menu.h"
#include "swad_nickname.h"
-#include "swad_photo_visibility.h"
+#include "swad_privacy.h"
#include "swad_role.h"
#include "swad_scope.h"
#include "swad_search.h"
@@ -127,7 +127,7 @@ struct UsrData
char Email [Cns_MAX_BYTES_STRING +1];
bool EmailConfirmed;
char Photo [Cry_LENGTH_ENCRYPTED_STR_SHA256_BASE64+1]; // Name of public link to photo
- Pho_Visibility_t PhotoVisibility; // Who can see user's photo
+ Pri_VISIBILITY_t PhotoVisibility; // Who can see user's photo
long CtyCod; // Country
char OriginPlace [Cns_MAX_BYTES_STRING+1];
struct Date Birthday;