From 9628123aae01985d41e51f3425ee8a84571acc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 29 May 2017 12:09:51 +0200 Subject: [PATCH] Version 16.225.9 --- swad_changelog.h | 3 +- swad_user.c | 108 +++++++++++++++++++++++++++++------------------ 2 files changed, 69 insertions(+), 42 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index c5169a5b8..3ecb6761b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -233,13 +233,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.225.8 (2017-05-29)" +#define Log_PLATFORM_VERSION "SWAD 16.225.9 (2017-05-29)" #define CSS_FILE "swad16.222.css" #define JS_FILE "swad16.206.3.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.225.9: May 29, 2017 Fixed minor bug in user administration. (220540 lines) Version 16.225.8: May 29, 2017 Statistics of hits in course accessible by non-editing teachers. Changes in error handlong in stats of hits. (220514 lines) Version 16.225.7: May 26, 2017 Fix bug in order of users when listing record cards of teachers. diff --git a/swad_user.c b/swad_user.c index 8e2772ea0..d86159fbe 100644 --- a/swad_user.c +++ b/swad_user.c @@ -6711,27 +6711,35 @@ void Usr_ListDataAdms (void) const char *FieldNames[Usr_NUM_MAIN_FIELDS_DATA_ADM]; /***** Put contextual links *****/ - if (Gbl.Usrs.Me.LoggedRole >= Rol_TCH) + switch (Gbl.Usrs.Me.LoggedRole) { - fprintf (Gbl.F.Out,"
"); + case Rol_TCH: + case Rol_DEG_ADM: + case Rol_CTR_ADM: + case Rol_INS_ADM: + case Rol_SYS_ADM: + fprintf (Gbl.F.Out,"
"); - if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) - { - /* Put link to remove old users */ - Usr_PutLinkToSeeGuests (); + if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) + { + /* Put link to remove old users */ + Usr_PutLinkToSeeGuests (); - /* Put link to list possible duplicate users */ - Dup_PutLinkToListDupUsrs (); - } + /* Put link to list possible duplicate users */ + Dup_PutLinkToListDupUsrs (); + } - /* Put link to go to admin one user */ - Enr_PutLinkToAdminOneUsr (ActReqMdfOneOth); + /* Put link to go to admin one user */ + Enr_PutLinkToAdminOneUsr (ActReqMdfOneOth); - if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) - /* Put link to remove old users */ - Enr_PutLinkToRemOldUsrs (); + if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) + /* Put link to remove old users */ + Enr_PutLinkToRemOldUsrs (); - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); + break; + default: + break; } /***** Initialize field names *****/ @@ -7332,29 +7340,38 @@ void Usr_SeeStudents (void) bool ICanViewRecords; /***** Put contextual links *****/ - if (Gbl.Usrs.Me.LoggedRole >= Rol_STD) + switch (Gbl.Usrs.Me.LoggedRole) { - fprintf (Gbl.F.Out,"
"); + case Rol_STD: + case Rol_TCH: + case Rol_DEG_ADM: + case Rol_CTR_ADM: + case Rol_INS_ADM: + case Rol_SYS_ADM: + fprintf (Gbl.F.Out,"
"); - if (Gbl.Usrs.Me.LoggedRole >= Rol_TCH) // I am logged as teacher or admin - { - /* Put link to go to admin one user */ - Enr_PutLinkToAdminOneUsr (ActReqMdfOneStd); - - if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected + if (Gbl.Usrs.Me.LoggedRole == Rol_STD) + /* Put link to go to admin me */ + Enr_PutLinkToAdminOneUsr (ActReqMdfOneStd); + else { - /* Put link to go to admin several users */ - Enr_PutLinkToAdminSeveralUsrs (Rol_STD); + /* Put link to go to admin one user */ + Enr_PutLinkToAdminOneUsr (ActReqMdfOneStd); - /* Put link to edit record fields */ - Rec_PutLinkToEditRecordFields (); + if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected + { + /* Put link to go to admin several users */ + Enr_PutLinkToAdminSeveralUsrs (Rol_STD); + + /* Put link to edit record fields */ + Rec_PutLinkToEditRecordFields (); + } } - } - else - /* Put link to go to admin one user */ - Enr_PutLinkToAdminOneUsr (ActReqMdfOneStd); - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); + break; + default: + break; } /***** Get and update type of list, @@ -7507,19 +7524,28 @@ void Usr_SeeTeachers (void) unsigned NumUsrs; /***** Put contextual links *****/ - if (Gbl.Usrs.Me.LoggedRole >= Rol_TCH) // I am logged as teacher or admin + switch (Gbl.Usrs.Me.LoggedRole) { - fprintf (Gbl.F.Out,"
"); + case Rol_NET: + case Rol_TCH: + case Rol_DEG_ADM: + case Rol_CTR_ADM: + case Rol_INS_ADM: + fprintf (Gbl.F.Out,"
"); - /* Put link to go to admin one user */ - Enr_PutLinkToAdminOneUsr (ActReqMdfOneTch); + /* Put link to go to admin one user */ + Enr_PutLinkToAdminOneUsr (ActReqMdfOneTch); - /* Put link to go to admin several users */ - if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected - Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM) // I am logged as admin - Enr_PutLinkToAdminSeveralUsrs (Rol_TCH); + /* Put link to go to admin several users */ + if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected + Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM) // I am logged as admin + Enr_PutLinkToAdminSeveralUsrs (Rol_TCH); - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); + + break; + default: + break; } /***** Get and update type of list,