mirror of https://github.com/acanas/swad-core.git
Version 16.54.5
This commit is contained in:
parent
6f6ee1f8ae
commit
a2df48e6bd
|
@ -156,13 +156,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.54.4 (2016-11-13)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.54.5 (2016-11-13)"
|
||||
#define CSS_FILE "swad16.51.css"
|
||||
#define JS_FILE "swad16.46.1.js"
|
||||
|
||||
// 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 sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 16.54.5: Nov 13, 2016 Frame and contextual help on role. (206771 lines)
|
||||
Version 16.54.4: Nov 13, 2016 Contextual help on creating a new account (sign up). (206747 lines)
|
||||
Version 16.54.3: Nov 13, 2016 Contextual help on log in. (206740 lines)
|
||||
Version 16.54.2: Nov 13, 2016 Contextual help on user's password. (206735 lines)
|
||||
|
|
|
@ -160,6 +160,7 @@ void Gbl_InitializeGlobals (void)
|
|||
Gbl.Usrs.Me.LoggedRole =
|
||||
Gbl.Usrs.Me.LoggedRoleBeforeCloseSession =
|
||||
Gbl.Usrs.Me.MaxRole = Rol_UNKNOWN;
|
||||
Gbl.Usrs.Me.RoleHasChanged = false;
|
||||
Gbl.Usrs.Me.IBelongToCurrentIns = false;
|
||||
Gbl.Usrs.Me.IBelongToCurrentCtr = false;
|
||||
Gbl.Usrs.Me.IBelongToCurrentDeg = false;
|
||||
|
|
|
@ -286,6 +286,7 @@ struct Globals
|
|||
Rol_Role_t LoggedRole;
|
||||
Rol_Role_t LoggedRoleBeforeCloseSession;
|
||||
Rol_Role_t MaxRole;
|
||||
bool RoleHasChanged; // Set when I have changed my role
|
||||
char UsrIdLogin[Usr_MAX_BYTES_USR_LOGIN+1]; // String to store the ID, nickname or e-mail entered in the user's login
|
||||
char LoginPlainPassword[Pwd_MAX_LENGTH_PLAIN_PASSWORD+1];
|
||||
char LoginEncryptedPassword[Cry_LENGTH_ENCRYPTED_STR_SHA512_BASE64+1];
|
||||
|
|
|
@ -56,6 +56,8 @@ const char *Hlp_PROFILE_Sign_up =
|
|||
"https://github.com/acanas/swad-core/wiki/PROFILE.Sign%20up";
|
||||
const char *Hlp_PROFILE_Account =
|
||||
"https://github.com/acanas/swad-core/wiki/PROFILE.Account";
|
||||
const char *Hlp_PROFILE_Session_role =
|
||||
"https://github.com/acanas/swad-core/wiki/PROFILE.Session#role";
|
||||
const char *Hlp_PROFILE_Password =
|
||||
"https://github.com/acanas/swad-core/wiki/PROFILE.Password";
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ void Pwd_ShowFormSendNewPwd (void)
|
|||
The_ClassForm[Gbl.Prefs.Theme],Txt_nick_email_or_ID,
|
||||
Usr_MAX_LENGTH_USR_LOGIN,Gbl.Usrs.Me.UsrIdLogin);
|
||||
|
||||
/***** Send button and end table *****/
|
||||
/***** Send button and end frame *****/
|
||||
Lay_EndRoundFrameWithButton (Lay_CONFIRM_BUTTON,Txt_Get_a_new_password);
|
||||
|
||||
/***** End form *****/
|
||||
|
|
|
@ -330,8 +330,10 @@ void Rol_ChangeMyRole (void)
|
|||
if (!(Gbl.Usrs.Me.AvailableRoles & (1 << UnsignedNum)))
|
||||
return;
|
||||
|
||||
/* New role is correct and is allowed for me, so change my logged user type */
|
||||
/* New role is correct and is allowed for me,
|
||||
so change my logged user type */
|
||||
Gbl.Usrs.Me.LoggedRole = (Rol_Role_t) UnsignedNum;
|
||||
Gbl.Usrs.Me.RoleHasChanged = true;
|
||||
|
||||
/* Update logged role in session */
|
||||
Ses_UpdateSessionDataInDB ();
|
||||
|
|
31
swad_user.c
31
swad_user.c
|
@ -2696,12 +2696,15 @@ static void Usr_SetUsrRoleAndPrefs (void)
|
|||
|
||||
void Usr_ShowFormsLogoutAndRole (void)
|
||||
{
|
||||
extern const char *Hlp_PROFILE_Session_role;
|
||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||
extern const char *Txt_Log_out;
|
||||
extern const char *Txt_Role;
|
||||
extern const char *Txt_You_are_LOGGED_as_X;
|
||||
extern const char *Txt_logged[Usr_NUM_SEXS];
|
||||
extern const char *Txt_ROLES_SINGUL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
extern const char *Txt_Role;
|
||||
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
unsigned NumAvailableRoles;
|
||||
|
||||
/***** Link to log out *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
|
||||
|
@ -2712,13 +2715,20 @@ void Usr_ShowFormsLogoutAndRole (void)
|
|||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/***** Write message with my new logged role *****/
|
||||
sprintf (Gbl.Message,Txt_You_are_LOGGED_as_X,
|
||||
Txt_logged[Gbl.Usrs.Me.UsrDat.Sex],
|
||||
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.LoggedRole][Gbl.Usrs.Me.UsrDat.Sex]);
|
||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||
if (Gbl.Usrs.Me.RoleHasChanged)
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_You_are_LOGGED_as_X,
|
||||
Txt_logged[Gbl.Usrs.Me.UsrDat.Sex],
|
||||
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.LoggedRole][Gbl.Usrs.Me.UsrDat.Sex]);
|
||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
}
|
||||
|
||||
/***** Start frame *****/
|
||||
Lay_StartRoundFrame (NULL,Txt_Role,NULL,Hlp_PROFILE_Session_role);
|
||||
|
||||
/***** Put a form to change my role *****/
|
||||
if (Rol_GetNumAvailableRoles () > 1)
|
||||
NumAvailableRoles = Rol_GetNumAvailableRoles ();
|
||||
if (NumAvailableRoles > 1)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<div class=\"%s CENTER_MIDDLE\">"
|
||||
"%s: ",
|
||||
|
@ -2726,6 +2736,15 @@ void Usr_ShowFormsLogoutAndRole (void)
|
|||
Rol_PutFormToChangeMyRole (false);
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT CENTER_MIDDLE\">"
|
||||
"%s: <span class=\"DAT_N_BOLD\">%s</span>"
|
||||
"</div>",
|
||||
Txt_Role,
|
||||
Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Me.LoggedRole][Gbl.Usrs.Me.UsrDat.Sex]);
|
||||
|
||||
/***** End frame *****/
|
||||
Lay_EndRoundFrame ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue