mirror of https://github.com/acanas/swad-core.git
Version 14.79.2
This commit is contained in:
parent
a509c959d7
commit
af48305df4
|
@ -103,12 +103,12 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 14.79.1 (2015/03/06)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 14.79.2 (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.79.2: Mar 06, 2015 Public profile is shown depending on visibility. (178759 lines)
|
||||
Version 14.79.1: Mar 06, 2015 Add options to change visibility of public profile. (178769 lines)
|
||||
3 changes necessary in database:
|
||||
ALTER TABLE usr_data ADD COLUMN ProfileVisibility ENUM('user','course','system','world') NOT NULL DEFAULT 'user' AFTER PhotoVisibility;
|
||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -46509,27 +46509,6 @@ const char *Txt_User_ID =
|
|||
"Nº de identif. do utilizador";
|
||||
#endif
|
||||
|
||||
const char *Txt_User_not_found =
|
||||
#if L==0
|
||||
"Usuari no trobat";
|
||||
#elif L==1
|
||||
"Benutzer nicht gefunden.";
|
||||
#elif L==2
|
||||
"User not found.";
|
||||
#elif L==3
|
||||
"Usuario/a no encontrado/a.";
|
||||
#elif L==4
|
||||
"Utilisateur introuvable.";
|
||||
#elif L==5
|
||||
"Usuario/a no encontrado/a."; // Okoteve traducción
|
||||
#elif L==6
|
||||
"IUtente non trovato.";
|
||||
#elif L==7
|
||||
"Nie znaleziono użytkownika.";
|
||||
#elif L==8
|
||||
"Utilizador não encontrado.";
|
||||
#endif
|
||||
|
||||
const char *Txt_User_not_found_or_you_do_not_have_permission_ =
|
||||
#if L==0
|
||||
"Usuari no trobat"
|
||||
|
|
38
swad_user.c
38
swad_user.c
|
@ -7385,9 +7385,10 @@ void Usr_RequestUserProfile (void)
|
|||
|
||||
void Usr_ShowUserProfile (void)
|
||||
{
|
||||
extern const char *Txt_User_not_found;
|
||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||
char Nickname[Nck_MAX_BYTES_NICKNAME_WITH_ARROBA + 1];
|
||||
long OtherUsrCod;
|
||||
bool Error = false;
|
||||
|
||||
/***** Get user *****/
|
||||
if (Gbl.Usrs.Other.UsrDat.UsrCod < 0)
|
||||
|
@ -7405,26 +7406,35 @@ void Usr_ShowUserProfile (void)
|
|||
/***** Check if user exists and get his data *****/
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat)) // Existing user
|
||||
{
|
||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
|
||||
/***** Check if I can see the public profile *****/
|
||||
if (Pri_ShowIsAllowed (Gbl.Usrs.Other.UsrDat.ProfileVisibility,Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||
{
|
||||
/* Get user's role in current course */
|
||||
Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB = Rol_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
|
||||
{
|
||||
/* Get user's role in current course */
|
||||
Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB = Rol_GetRoleInCrs (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
|
||||
/* Get if user has accepted enrollment in current course */
|
||||
Gbl.Usrs.Other.UsrDat.Accepted = Usr_GetIfUserHasAcceptedEnrollmentInCurrentCrs (Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
/* Get if user has accepted enrollment in current course */
|
||||
Gbl.Usrs.Other.UsrDat.Accepted = Usr_GetIfUserHasAcceptedEnrollmentInCurrentCrs (Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
}
|
||||
|
||||
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
||||
|
||||
/***** Common record *****/
|
||||
Rec_ShowSharedUsrRecord (Rec_RECORD_PUBLIC,&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
||||
|
||||
/***** Common record *****/
|
||||
Rec_ShowSharedUsrRecord (Rec_RECORD_PUBLIC,&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
else
|
||||
Error = true;
|
||||
}
|
||||
else
|
||||
Error = true;
|
||||
|
||||
if (Error)
|
||||
{
|
||||
/***** Show error message *****/
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found);
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
|
||||
/***** Request nickname again *****/
|
||||
Usr_RequestUserProfile ();
|
||||
|
|
Loading…
Reference in New Issue