From b0a9ad9582c2ee39776c21f05f074bf635feb25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 19 Jan 2017 18:32:28 +0100 Subject: [PATCH] Version 16.120.1 --- swad_changelog.h | 3 ++- swad_record.c | 20 +++++++++++++------- swad_string.c | 6 +++--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index da39d702f..0935f4e63 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -193,13 +193,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.120 (2017-01-19)" +#define Log_PLATFORM_VERSION "SWAD 16.120.1 (2017-01-19)" #define CSS_FILE "swad16.119.4.css" #define JS_FILE "swad16.119.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.120.1: Jan 19, 2017 From now on, a teacher A can enroll another user B as a teacher in their courses, although user B is not yet a teacher in any course. (? lines) Version 16.120: Jan 19, 2017 Fixed bug when limiting length of links. (211934 lines) Version 16.119.4: Jan 18, 2017 Changes in layout of current data and time. (211882 lines) Version 16.119.3: Jan 17, 2017 Changes in layout of current data and time. (211881 lines) diff --git a/swad_record.c b/swad_record.c index f41780fd0..6a5d9e072 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2795,6 +2795,7 @@ static void Rec_ShowRole (struct UsrData *UsrDat, (unsigned) Gbl.Usrs.Me.LoggedRole, Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Me.LoggedRole][UsrDat->Sex]); break; + /* case Rol_TEACHER: for (Role = Rol_STUDENT; Role <= Rol_TEACHER; @@ -2809,6 +2810,8 @@ static void Rec_ShowRole (struct UsrData *UsrDat, Txt_ROLES_SINGUL_Abc[Role][UsrDat->Sex]); } break; + */ + case Rol_TEACHER: case Rol_DEG_ADM: case Rol_CTR_ADM: case Rol_INS_ADM: @@ -3527,20 +3530,23 @@ Rol_Role_t Rec_GetRoleFromRecordForm (void) if (Role == Rol_STUDENT) RoleOK = true; break; + /* case Rol_TEACHER: // I am logged as teacher - /* A teacher can only register another user as teacher - if the other is already teacher in any course. - That is, a teacher can not upgrade a student - (in all other courses) to teacher */ + // A teacher can only register another user as teacher + // if the other is already teacher in any course. + // That is, a teacher can not upgrade a student + // (in all other courses) to teacher Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Other.UsrDat); if ( Role == Rol_STUDENT || (Role == Rol_TEACHER && // He/she will be a teacher in current course (Gbl.Usrs.Other.UsrDat.Roles & (1 << Rol_TEACHER)))) // He/she was a teacher in some courses RoleOK = true; break; - case Rol_DEG_ADM: // I am logged as admin - case Rol_CTR_ADM: - case Rol_INS_ADM: + */ + case Rol_TEACHER: // I am logged as teacher + case Rol_DEG_ADM: // I am logged as degree admin + case Rol_CTR_ADM: // I am logged as centre admin + case Rol_INS_ADM: // I am logged as institution admin if (Role == Rol_STUDENT || Role == Rol_TEACHER) RoleOK = true; diff --git a/swad_string.c b/swad_string.c index 8c0665c4f..ed9195530 100644 --- a/swad_string.c +++ b/swad_string.c @@ -639,17 +639,17 @@ static unsigned Str_FindHTMLEntity (const char *Ptr) size_t Length = 0; char Ch; - /***** Check first character *****/ + /***** The first character must be '&' *****/ if (Ptr[Length] != '&') return 0; // No HTML entity found - /***** Check second character *****/ + /***** The second character can be '#' *****/ Length++; if (Ptr[Length] == '#') /* Go to third character */ Length++; - /***** Now some alphanumeric characters are expected *****/ + /***** Now one or more alphanumeric characters are expected *****/ /* Check second/third character */ Ch = Ptr[Length]; if (!((Ch >= '0' && Ch <= '9') ||