diff --git a/sql/swad.sql b/sql/swad.sql index 2b2632087..db5ea32a3 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -237,7 +237,6 @@ CREATE TABLE IF NOT EXISTS courses ( DegCod INT NOT NULL DEFAULT -1, Year TINYINT NOT NULL DEFAULT 0, InsCrsCod CHAR(7) NOT NULL, - AllowDirectLogIn ENUM('N','Y') NOT NULL DEFAULT 'Y', Status TINYINT NOT NULL DEFAULT 0, RequesterUsrCod INT NOT NULL DEFAULT -1, ShortName VARCHAR(32) COLLATE latin1_spanish_ci NOT NULL, @@ -378,7 +377,6 @@ CREATE TABLE IF NOT EXISTS debug ( CREATE TABLE IF NOT EXISTS deg_types ( DegTypCod INT NOT NULL AUTO_INCREMENT, DegTypName VARCHAR(32) NOT NULL, - AllowDirectLogIn ENUM('N','Y') NOT NULL DEFAULT 'Y', UNIQUE INDEX(DegTypCod)); -- -- Table degrees: stores the degrees diff --git a/swad_action.c b/swad_action.c index 602bffcfa..963f10d13 100644 --- a/swad_action.c +++ b/swad_action.c @@ -110,7 +110,6 @@ System: 27. ActNewDegTyp Request the creation of a type of degree 28. ActRemDegTyp Request the removal of a type of degree 29. ActRenDegTyp Request renaming of a type of degree - 30. ActChgDegTypLog REquest changing whether direct log in is allowd 31. ActRemOldCrs Remove completely old courses 32. ActEdiMai Edit mail domains @@ -1381,7 +1380,6 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActNewDegTyp */{ 537,-1,TabSys,ActSeeDegTyp ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_RecFormNewDegTyp ,NULL}, /* ActRemDegTyp */{ 545,-1,TabSys,ActSeeDegTyp ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_RemoveDegreeType ,NULL}, /* ActRenDegTyp */{ 538,-1,TabSys,ActSeeDegTyp ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_RenameDegreeType ,NULL}, - /* ActChgDegTypLog */{1006,-1,TabSys,ActSeeDegTyp ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegTypeLogIn ,NULL}, /* ActRemOldCrs */{1110,-1,TabSys,ActReqRemOldCrs ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Crs_RemoveOldCrss ,NULL}, @@ -3717,7 +3715,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq -1, // #1003 (obsolete action) -1, // #1004 (obsolete action) -1, // #1005 (obsolete action) - ActChgDegTypLog, // #1006 + -1, // #1006 (obsolete action) ActReqImpTstQst, // #1007 ActImpTstQst, // #1008 ActSeeCrs, // #1009 diff --git a/swad_action.h b/swad_action.h index 3da8f035d..8f7e36cde 100644 --- a/swad_action.h +++ b/swad_action.h @@ -71,7 +71,7 @@ typedef enum typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1+9+52+15+90+70+67+205+183+143+172+36+27+83) +#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+205+183+143+172+36+27+83) #define Act_MAX_ACTION_COD 1521 @@ -121,42 +121,41 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica #define ActNewDegTyp (ActWebSvc+ 18) #define ActRemDegTyp (ActWebSvc+ 19) #define ActRenDegTyp (ActWebSvc+ 20) -#define ActChgDegTypLog (ActWebSvc+ 21) -#define ActRemOldCrs (ActWebSvc+ 22) -#define ActEdiMai (ActWebSvc+ 23) -#define ActNewMai (ActWebSvc+ 24) -#define ActRemMai (ActWebSvc+ 25) -#define ActRenMaiSho (ActWebSvc+ 26) -#define ActRenMaiFul (ActWebSvc+ 27) +#define ActRemOldCrs (ActWebSvc+ 21) +#define ActEdiMai (ActWebSvc+ 22) +#define ActNewMai (ActWebSvc+ 23) +#define ActRemMai (ActWebSvc+ 24) +#define ActRenMaiSho (ActWebSvc+ 25) +#define ActRenMaiFul (ActWebSvc+ 26) -#define ActEdiBan (ActWebSvc+ 28) -#define ActNewBan (ActWebSvc+ 29) -#define ActRemBan (ActWebSvc+ 30) -#define ActShoBan (ActWebSvc+ 31) -#define ActHidBan (ActWebSvc+ 32) -#define ActRenBanSho (ActWebSvc+ 33) -#define ActRenBanFul (ActWebSvc+ 34) -#define ActChgBanImg (ActWebSvc+ 35) -#define ActChgBanWWW (ActWebSvc+ 36) -#define ActClkBan (ActWebSvc+ 37) +#define ActEdiBan (ActWebSvc+ 27) +#define ActNewBan (ActWebSvc+ 28) +#define ActRemBan (ActWebSvc+ 29) +#define ActShoBan (ActWebSvc+ 30) +#define ActHidBan (ActWebSvc+ 31) +#define ActRenBanSho (ActWebSvc+ 32) +#define ActRenBanFul (ActWebSvc+ 33) +#define ActChgBanImg (ActWebSvc+ 34) +#define ActChgBanWWW (ActWebSvc+ 35) +#define ActClkBan (ActWebSvc+ 36) -#define ActEdiLnk (ActWebSvc+ 38) -#define ActNewLnk (ActWebSvc+ 39) -#define ActRemLnk (ActWebSvc+ 40) -#define ActRenLnkSho (ActWebSvc+ 41) -#define ActRenLnkFul (ActWebSvc+ 42) -#define ActChgLnkWWW (ActWebSvc+ 43) +#define ActEdiLnk (ActWebSvc+ 37) +#define ActNewLnk (ActWebSvc+ 38) +#define ActRemLnk (ActWebSvc+ 39) +#define ActRenLnkSho (ActWebSvc+ 40) +#define ActRenLnkFul (ActWebSvc+ 41) +#define ActChgLnkWWW (ActWebSvc+ 42) -#define ActEdiPlg (ActWebSvc+ 44) -#define ActNewPlg (ActWebSvc+ 45) -#define ActRemPlg (ActWebSvc+ 46) -#define ActRenPlg (ActWebSvc+ 47) -#define ActChgPlgDes (ActWebSvc+ 48) -#define ActChgPlgLog (ActWebSvc+ 49) -#define ActChgPlgAppKey (ActWebSvc+ 50) -#define ActChgPlgURL (ActWebSvc+ 51) -#define ActChgPlgIP (ActWebSvc+ 52) +#define ActEdiPlg (ActWebSvc+ 43) +#define ActNewPlg (ActWebSvc+ 44) +#define ActRemPlg (ActWebSvc+ 45) +#define ActRenPlg (ActWebSvc+ 46) +#define ActChgPlgDes (ActWebSvc+ 47) +#define ActChgPlgLog (ActWebSvc+ 48) +#define ActChgPlgAppKey (ActWebSvc+ 49) +#define ActChgPlgURL (ActWebSvc+ 50) +#define ActChgPlgIP (ActWebSvc+ 51) /*****************************************************************************/ /******************************** Country tab ********************************/ diff --git a/swad_changelog.h b/swad_changelog.h index b59e76c47..c26e7df33 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -115,7 +115,6 @@ // TODO: Go to forum post (or at least to forum thread) from social timeline and notifications? // TODO: Width of column for data in notifications is too short // TODO: Change size of DegTypName in table deg_types from VARCHAR(32) TO VARCHAR(255) -// TODO: Remove AllowDirectLogIn in table deg_types // TODO: If a follower follows a user whose profile is no longer visible ==> put icon to unfollow in list of followed // TODO: FIX BUG: In results of search of students, no mark of confirmation is shown even if the student really has confirmed his/her registration in the course // TODO: Insert "http://" to WWW when WWW does not start with "*://" @@ -124,13 +123,19 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.143.6 (2016-03-03)" +#define Log_PLATFORM_VERSION "SWAD 15.144 (2016-03-03)" #define CSS_FILE "swad15.137.2.css" #define JS_FILE "swad15.131.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 15.144: Mar 03, 2016 Direct login always available. (195755 lines) + 3 changes necessary in database: +ALTER TABLE courses DROP COLUMN AllowDirectLogIn; +ALTER TABLE deg_types DROP COLUMN AllowDirectLogIn; +UPDATE actions SET Obsolete='Y' WHERE ActCod='1006'; + Version 15.143.6: Mar 03, 2016 Direct login forms unavailable when external login service unavailable. (196219 lines) Version 15.143.5: Mar 02, 2016 Changed text messages related to edition of courses. (196166 lines) Version 15.143.4: Mar 02, 2016 Changed text messages related to edition of degrees. (196126 lines) diff --git a/swad_course.c b/swad_course.c index 13945af6b..c956785e4 100644 --- a/swad_course.c +++ b/swad_course.c @@ -74,7 +74,6 @@ extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; /*****************************************************************************/ static void Crs_Configuration (bool PrintView); -static void Crs_PutFormToConfigLogIn (bool IsForm); static void Crs_WriteListMyCoursesToSelectOne (void); @@ -327,10 +326,6 @@ static void Crs_Configuration (bool PrintView) } else { - /***** Choice whether a course allows direct log in *****/ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - Crs_PutFormToConfigLogIn (IsForm); - /***** Number of teachers *****/ fprintf (Gbl.F.Out,"" "" @@ -392,50 +387,6 @@ static void Crs_Configuration (bool PrintView) Act_FormEnd (); } -/*****************************************************************************/ -/********* Put form to choice whether a course allows direct log in **********/ -/*****************************************************************************/ - -static void Crs_PutFormToConfigLogIn (bool IsForm) - { - extern const char *The_ClassForm[The_NUM_THEMES]; - extern const char *Txt_Students_authentication; - extern const char *Txt_STUDENTS_must_enter_through_X; - extern const char *Txt_STUDENTS_may_enter_directly; - - /***** Can students enter directly? *****/ - fprintf (Gbl.F.Out,"" - "" - "%s:" - "" - "", - The_ClassForm[Gbl.Prefs.Theme], - Txt_Students_authentication); - - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,Txt_STUDENTS_must_enter_through_X, - Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME); - fprintf (Gbl.F.Out,"
"); - - fprintf (Gbl.F.Out,"%s", - Txt_STUDENTS_may_enter_directly); - - fprintf (Gbl.F.Out,"" - ""); - } - /*****************************************************************************/ /******************** Change the configuration of a course *******************/ /*****************************************************************************/ @@ -445,7 +396,6 @@ void Crs_ChangeCourseConfig (void) extern const char *Txt_The_configuration_of_the_course_X_has_been_updated; char Query[512]; char YearStr[2+1]; - char YN[1+1]; /***** Get parameters from form *****/ /* Get institutional code */ @@ -455,22 +405,11 @@ void Crs_ChangeCourseConfig (void) Par_GetParToText ("OthCrsYear",YearStr,2); Gbl.CurrentCrs.Crs.Year = Deg_ConvStrToYear (YearStr); - /* Get whether this course allows direct log in or not */ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - { - Par_GetParToText ("AllowDirectLogIn",YN,1); - Gbl.CurrentCrs.Crs.AllowDirectLogIn = (Str_ConvertToUpperLetter (YN[0]) == 'Y'); - } - else - Gbl.CurrentCrs.Crs.AllowDirectLogIn = true; - /***** Update table of degree types *****/ - sprintf (Query,"UPDATE courses SET InsCrsCod='%s',Year='%u',AllowDirectLogIn='%c'" + sprintf (Query,"UPDATE courses SET InsCrsCod='%s',Year='%u'" " WHERE CrsCod='%ld'", Gbl.CurrentCrs.Crs.InstitutionalCrsCod, Gbl.CurrentCrs.Crs.Year, - Gbl.CurrentCrs.Crs.AllowDirectLogIn ? 'Y' : - 'N', Gbl.CurrentCrs.Crs.CrsCod); DB_QueryUPDATE (Query,"can not update the configuration of a course"); @@ -1007,13 +946,13 @@ static void Crs_GetListCoursesInDegree (Crs_WhatCourses_t WhatCourses) switch (WhatCourses) { case Crs_ACTIVE_COURSES: - sprintf (Query,"SELECT CrsCod,DegCod,Year,InsCrsCod,AllowDirectLogIn,Status,RequesterUsrCod,ShortName,FullName" + sprintf (Query,"SELECT CrsCod,DegCod,Year,InsCrsCod,Status,RequesterUsrCod,ShortName,FullName" " FROM courses WHERE DegCod='%ld' AND Status=0" " ORDER BY Year,ShortName", Gbl.CurrentDeg.Deg.DegCod); break; case Crs_ALL_COURSES_EXCEPT_REMOVED: - sprintf (Query,"SELECT CrsCod,DegCod,Year,InsCrsCod,AllowDirectLogIn,Status,RequesterUsrCod,ShortName,FullName" + sprintf (Query,"SELECT CrsCod,DegCod,Year,InsCrsCod,Status,RequesterUsrCod,ShortName,FullName" " FROM courses WHERE DegCod='%ld' AND (Status & %u)=0" " ORDER BY Year,ShortName", Gbl.CurrentDeg.Deg.DegCod, @@ -1973,12 +1912,10 @@ static void Crs_CreateCourse (struct Course *Crs,unsigned Status) /***** Insert new course into pending requests *****/ sprintf (Query,"INSERT INTO courses (DegCod,Year,InsCrsCod," - "AllowDirectLogIn,Status,RequesterUsrCod,ShortName,FullName)" - " VALUES ('%ld','%u','%s','%c','%u','%ld','%s','%s')", + "Status,RequesterUsrCod,ShortName,FullName)" + " VALUES ('%ld','%u','%s','%u','%ld','%s','%s')", Crs->DegCod,Crs->Year, Crs->InstitutionalCrsCod, - Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0] ? 'N' : - 'Y', Status, Gbl.Usrs.Me.UsrDat.UsrCod, Crs->ShortName,Crs->FullName); @@ -2051,10 +1988,6 @@ bool Crs_GetDataOfCourseByCod (struct Course *Crs) Crs->CrsCod = -1L; Crs->DegCod = -1L; Crs->Year = 0; - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - Crs->AllowDirectLogIn = false; - else - Crs->AllowDirectLogIn = true; Crs->Status = (Crs_Status_t) 0; Crs->RequesterUsrCod = -1L; Crs->ShortName[0] = '\0'; @@ -2066,7 +1999,7 @@ bool Crs_GetDataOfCourseByCod (struct Course *Crs) } /***** Get data of a course from database *****/ - sprintf (Query,"SELECT CrsCod,DegCod,Year,InsCrsCod,AllowDirectLogIn,Status,RequesterUsrCod,ShortName,FullName" + sprintf (Query,"SELECT CrsCod,DegCod,Year,InsCrsCod,Status,RequesterUsrCod,ShortName,FullName" " FROM courses WHERE CrsCod='%ld'", Crs->CrsCod); NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get data of a course"); @@ -2084,10 +2017,6 @@ bool Crs_GetDataOfCourseByCod (struct Course *Crs) Crs->CrsCod = -1L; Crs->DegCod = -1L; Crs->Year = 0; - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - Crs->AllowDirectLogIn = false; - else - Crs->AllowDirectLogIn = true; Crs->Status = (Crs_Status_t) 0; Crs->RequesterUsrCod = -1L; Crs->ShortName[0] = '\0'; @@ -2125,12 +2054,6 @@ static void Crs_GetDataOfCourseFromRow (struct Course *Crs,MYSQL_ROW row) strncpy (Crs->InstitutionalCrsCod,row[3],Crs_LENGTH_INSTITUTIONAL_CRS_COD); Crs->InstitutionalCrsCod[Crs_LENGTH_INSTITUTIONAL_CRS_COD] = '\0'; - /***** Get whether this course allows direct log in or not (row[4]) *****/ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - Crs->AllowDirectLogIn = (Str_ConvertToUpperLetter (row[4][0]) == 'Y'); - else - Crs->AllowDirectLogIn = true; - /***** Get course status (row[5]) *****/ if (sscanf (row[5],"%u",&(Crs->Status)) != 1) Lay_ShowErrorAndExit ("Wrong course status."); diff --git a/swad_course.h b/swad_course.h index 2788c4ded..aae7ed79d 100644 --- a/swad_course.h +++ b/swad_course.h @@ -78,7 +78,6 @@ struct Course char InstitutionalCrsCod[Crs_LENGTH_INSTITUTIONAL_CRS_COD+1]; // Institutional code of the course long DegCod; unsigned Year; // Year: 0 (optatives), 1, 2, 3... - bool AllowDirectLogIn; // Students may enter directly, or must enter via external plugin? Crs_Status_t Status; // Course status long RequesterUsrCod; // User code of the person who requested the creation of this course char ShortName[Crs_MAX_LENGTH_COURSE_SHORT_NAME+1]; // Short name of course diff --git a/swad_database.c b/swad_database.c index ccd09b9d6..7039eee6d 100644 --- a/swad_database.c +++ b/swad_database.c @@ -556,27 +556,25 @@ mysql> DESCRIBE countries; /***** Table courses *****/ /* mysql> DESCRIBE courses; -+------------------+---------------+------+-----+---------+----------------+ -| Field | Type | Null | Key | Default | Extra | -+------------------+---------------+------+-----+---------+----------------+ -| CrsCod | int(11) | NO | PRI | NULL | auto_increment | -| DegCod | int(11) | NO | MUL | -1 | | -| Year | tinyint(4) | NO | | 0 | | -| InsCrsCod | char(7) | NO | | NULL | | -| AllowDirectLogIn | enum('N','Y') | NO | | Y | | -| Status | tinyint(4) | NO | MUL | 0 | | -| RequesterUsrCod | int(11) | NO | | -1 | | -| ShortName | varchar(32) | NO | | NULL | | -| FullName | varchar(127) | NO | | NULL | | -+------------------+---------------+------+-----+---------+----------------+ -9 rows in set (0.01 sec) ++-----------------+--------------+------+-----+---------+----------------+ +| Field | Type | Null | Key | Default | Extra | ++-----------------+--------------+------+-----+---------+----------------+ +| CrsCod | int(11) | NO | PRI | NULL | auto_increment | +| DegCod | int(11) | NO | MUL | -1 | | +| Year | tinyint(4) | NO | | 0 | | +| InsCrsCod | char(7) | NO | | NULL | | +| Status | tinyint(4) | NO | MUL | 0 | | +| RequesterUsrCod | int(11) | NO | | -1 | | +| ShortName | varchar(32) | NO | | NULL | | +| FullName | varchar(127) | NO | | NULL | | ++-----------------+--------------+------+-----+---------+----------------+ +8 rows in set (0.00 sec) */ DB_CreateTable ("CREATE TABLE IF NOT EXISTS courses (" "CrsCod INT NOT NULL AUTO_INCREMENT," "DegCod INT NOT NULL DEFAULT -1," "Year TINYINT NOT NULL DEFAULT 0," "InsCrsCod CHAR(7) NOT NULL," - "AllowDirectLogIn ENUM('N','Y') NOT NULL DEFAULT 'Y'," "Status TINYINT NOT NULL DEFAULT 0," "RequesterUsrCod INT NOT NULL DEFAULT -1," "ShortName VARCHAR(32) COLLATE latin1_spanish_ci NOT NULL," @@ -839,19 +837,17 @@ mysql> DESCRIBE crs_usr_requests; /***** Table deg_types *****/ /* mysql> DESCRIBE deg_types; -+------------------+---------------+------+-----+---------+----------------+ -| Field | Type | Null | Key | Default | Extra | -+------------------+---------------+------+-----+---------+----------------+ -| DegTypCod | int(11) | NO | PRI | NULL | auto_increment | -| DegTypName | varchar(32) | NO | | NULL | | -| AllowDirectLogIn | enum('N','Y') | NO | | Y | | -+------------------+---------------+------+-----+---------+----------------+ -3 rows in set (0.00 sec) ++------------+-------------+------+-----+---------+----------------+ +| Field | Type | Null | Key | Default | Extra | ++------------+-------------+------+-----+---------+----------------+ +| DegTypCod | int(11) | NO | PRI | NULL | auto_increment | +| DegTypName | varchar(32) | NO | | NULL | | ++------------+-------------+------+-----+---------+----------------+ +2 rows in set (0.00 sec) */ DB_CreateTable ("CREATE TABLE IF NOT EXISTS deg_types (" "DegTypCod INT NOT NULL AUTO_INCREMENT," "DegTypName VARCHAR(32) NOT NULL," - "AllowDirectLogIn ENUM('N','Y') NOT NULL DEFAULT 'Y'," "UNIQUE INDEX(DegTypCod))"); /***** Table degrees *****/ diff --git a/swad_degree.c b/swad_degree.c index cf9c870e6..12292649e 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -1148,8 +1148,6 @@ static void Deg_ListDegreeTypesForSeeing (void) extern const char *Txt_Types_of_degree; extern const char *Txt_TYPES_OF_DEGREE_With_degrees; extern const char *Txt_TYPES_OF_DEGREE_Without_degrees; - extern const char *Txt_Direct_authentication_allowed; - extern const char *Txt_Direct_authentication_not_allowed; unsigned NumDegTyp; const char *BgColor; @@ -1189,22 +1187,6 @@ static void Deg_ListDegreeTypesForSeeing (void) "", BgColor,Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypName); - /* Direct log in is allowed for this degree type? */ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - fprintf (Gbl.F.Out,"" - "\"%s\"" - "", - BgColor, - Gbl.Prefs.IconsURL, - Gbl.Degs.DegTypes.Lst[NumDegTyp].AllowDirectLogIn ? "ok_green" : - "tr", - Gbl.Degs.DegTypes.Lst[NumDegTyp].AllowDirectLogIn ? Txt_Direct_authentication_allowed : - Txt_Direct_authentication_not_allowed, - Gbl.Degs.DegTypes.Lst[NumDegTyp].AllowDirectLogIn ? Txt_Direct_authentication_allowed : - Txt_Direct_authentication_not_allowed); - /* Number of degrees of this type */ fprintf (Gbl.F.Out,"" "%u" @@ -1269,21 +1251,6 @@ static void Deg_ListDegreeTypesForEdition (void) Act_FormEnd (); fprintf (Gbl.F.Out,""); - /* Direct log in is allowed for this degree type? */ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - { - fprintf (Gbl.F.Out,""); - Act_FormStart (ActChgDegTypLog); - Deg_PutParamOtherDegTypCod (Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypCod); - fprintf (Gbl.F.Out,"", - Gbl.Degs.DegTypes.Lst[NumDegTyp].AllowDirectLogIn ? " checked=\"checked\"" : - "", - Gbl.Form.Id); - Act_FormEnd (); - fprintf (Gbl.F.Out,""); - } - /* Number of degrees of this type */ fprintf (Gbl.F.Out,"" "%u" @@ -1697,7 +1664,6 @@ static void Deg_PutFormToCreateDegType (void) { extern const char *Txt_New_type_of_degree; extern const char *Txt_Type_of_BR_degree; - extern const char *Txt_Direct_authentication; extern const char *Txt_Create_type_of_degree; /***** Start form *****/ @@ -1710,14 +1676,9 @@ static void Deg_PutFormToCreateDegType (void) fprintf (Gbl.F.Out,"" "" "%s" - "", + "" + "", Txt_Type_of_BR_degree); - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - fprintf (Gbl.F.Out,"" - "%s" - "", - Txt_Direct_authentication); - fprintf (Gbl.F.Out,""); /***** Degree type name *****/ fprintf (Gbl.F.Out,"" @@ -1727,17 +1688,6 @@ static void Deg_PutFormToCreateDegType (void) "", Deg_MAX_LENGTH_DEGREE_TYPE_NAME,Gbl.Degs.EditingDegTyp.DegTypName); - /***** Direct log in is allowed for this degree type? *****/ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - fprintf (Gbl.F.Out,"" - "" - "" - "" - "", - Gbl.Degs.EditingDegTyp.AllowDirectLogIn ? " checked=\"checked\"" : - ""); - - /***** Send button and end frame *****/ Lay_EndRoundFrameTableWithButton (Lay_CREATE_BUTTON,Txt_Create_type_of_degree); @@ -1879,24 +1829,18 @@ static void Deg_PutFormToCreateDegree (void) static void Deg_PutHeadDegreeTypesForSeeing (void) { extern const char *Txt_Type_of_BR_degree; - extern const char *Txt_Direct_authentication; extern const char *Txt_Degrees_ABBREVIATION; fprintf (Gbl.F.Out,"" "" "" "%s" - "", - Txt_Type_of_BR_degree); - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - fprintf (Gbl.F.Out,"" - "%s" - "", - Txt_Direct_authentication); - fprintf (Gbl.F.Out,"" + "" + "" "%s" "" "", + Txt_Type_of_BR_degree, Txt_Degrees_ABBREVIATION); } @@ -1908,7 +1852,6 @@ static void Deg_PutHeadDegreeTypesForEdition (void) { extern const char *Txt_Code; extern const char *Txt_Type_of_BR_degree; - extern const char *Txt_Direct_authentication; extern const char *Txt_Degrees_ABBREVIATION; fprintf (Gbl.F.Out,"" @@ -1918,19 +1861,13 @@ static void Deg_PutHeadDegreeTypesForEdition (void) "" "" "%s" - "", - Txt_Code, - Txt_Type_of_BR_degree); - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - fprintf (Gbl.F.Out,"" - "%s" - "" - "", - Txt_Direct_authentication); - fprintf (Gbl.F.Out,"" + "" + "" "%s" "" "", + Txt_Code, + Txt_Type_of_BR_degree, Txt_Degrees_ABBREVIATION); } @@ -2051,15 +1988,9 @@ static void Deg_CreateDegreeType (struct DegreeType *DegTyp) extern const char *Txt_Created_new_type_of_degree_X; char Query[128+Deg_MAX_LENGTH_DEGREE_TYPE_NAME]; - if (!Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service does not exist - DegTyp->AllowDirectLogIn = true; - /***** Create a new degree type *****/ - sprintf (Query,"INSERT INTO deg_types" - " SET DegTypName='%s',AllowDirectLogIn='%c'", - DegTyp->DegTypName, - DegTyp->AllowDirectLogIn ? 'Y' : - 'N'); + sprintf (Query,"INSERT INTO deg_types SET DegTypName='%s'", + DegTyp->DegTypName); DB_QueryINSERT (Query,"can not create a new type of degree"); /***** Write success message *****/ @@ -2229,12 +2160,6 @@ static void Deg_GetListDegTypes (void) strncpy (Gbl.Degs.DegTypes.Lst[NumRow].DegTypName,row[1],Deg_MAX_LENGTH_DEGREE_TYPE_NAME); Gbl.Degs.DegTypes.Lst[NumRow].DegTypName[Deg_MAX_LENGTH_DEGREE_TYPE_NAME] = '\0'; - /* Get whether this degree type allows direct log in or not (row[2]) */ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - Gbl.Degs.DegTypes.Lst[NumRow].AllowDirectLogIn = (Str_ConvertToUpperLetter (row[2][0]) == 'Y'); - else - Gbl.Degs.DegTypes.Lst[NumRow].AllowDirectLogIn = true; - /* Number of degrees of this type (row[3]) */ if (sscanf (row[3],"%u",&Gbl.Degs.DegTypes.Lst[NumRow].NumDegs) != 1) Lay_ShowErrorAndExit ("Error when getting number of degrees of a type"); @@ -2450,7 +2375,6 @@ void Deg_RecFormNewDegTyp (void) extern const char *Txt_The_type_of_degree_X_already_exists; extern const char *Txt_You_must_specify_the_name_of_the_new_type_of_degree; struct DegreeType *DegTyp; - char YN[1+1]; DegTyp = &Gbl.Degs.EditingDegTyp; @@ -2458,15 +2382,6 @@ void Deg_RecFormNewDegTyp (void) /* Get the name of degree type */ Par_GetParToText ("DegTypName",DegTyp->DegTypName,Deg_MAX_LENGTH_DEGREE_TYPE_NAME); - /* Get whether this degree type allows direct log in or not */ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - { - Par_GetParToText ("AllowDirectLogIn",YN,1); - DegTyp->AllowDirectLogIn = (Str_ConvertToUpperLetter (YN[0]) == 'Y'); - } - else - DegTyp->AllowDirectLogIn = true; - if (DegTyp->DegTypName[0]) // If there's a degree type name { /***** If name of degree type was in database... *****/ @@ -2727,17 +2642,12 @@ bool Deg_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp) { DegTyp->DegTypCod = -1L; DegTyp->DegTypName[0] = '\0'; - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - DegTyp->AllowDirectLogIn = false; - else - DegTyp->AllowDirectLogIn = true; DegTyp->NumDegs = 0; return false; } /***** Get the name of a type of degree from database *****/ - sprintf (Query,"SELECT DegTypName,AllowDirectLogIn" - " FROM deg_types WHERE DegTypCod='%ld'", + sprintf (Query,"SELECT DegTypName FROM deg_types WHERE DegTypCod='%ld'", DegTyp->DegTypCod); NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get the name of a type of degree"); @@ -2749,12 +2659,6 @@ bool Deg_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp) /* Get the name of the degree type (row[0]) */ strcpy (DegTyp->DegTypName,row[0]); - /* Get whether this degree type allows direct log in or not (row[1]) */ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - DegTyp->AllowDirectLogIn = (Str_ConvertToUpperLetter (row[1][0]) == 'Y'); - else - DegTyp->AllowDirectLogIn = true; - /* Count number of degrees of this type */ DegTyp->NumDegs = Deg_CountNumDegsOfType (DegTyp->DegTypCod); @@ -2765,10 +2669,6 @@ bool Deg_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp) { DegTyp->DegTypCod = -1L; DegTyp->DegTypName[0] = '\0'; - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - DegTyp->AllowDirectLogIn = false; - else - DegTyp->AllowDirectLogIn = true; DegTyp->NumDegs = 0; return false; } @@ -3336,57 +3236,6 @@ static bool Deg_CheckIfDegreeNameExists (long CtrCod,const char *FieldName,const return (DB_QueryCOUNT (Query,"can not check if the name of a degree already existed") != 0); } -/*****************************************************************************/ -/************* Change whether a degree type allows direct log in *************/ -/*****************************************************************************/ - -void Deg_ChangeDegTypeLogIn (void) - { - extern const char *Txt_The_type_of_degree_X_now_allows_direct_authentication; - extern const char *Txt_The_type_of_degree_X_no_longer_allows_direct_authentication; - struct DegreeType *DegTyp; - char Query[512]; - char YN[1+1]; - - DegTyp = &Gbl.Degs.EditingDegTyp; - - /***** Get parameters from form *****/ - /* Get degree type code */ - if ((DegTyp->DegTypCod = Deg_GetParamOtherDegTypCod ()) == -1L) - Lay_ShowErrorAndExit ("Code of degree type is missing."); - - /* Get data of the degree type from database */ - if (!Deg_GetDataOfDegreeTypeByCod (DegTyp)) - Lay_ShowErrorAndExit ("Code of type of degree not found."); - - /* Get whether this degree type allows direct log in or not */ - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - { - // Do this after getting data of degree type in order to overwrite AllowDirectLogIn with the user preference - Par_GetParToText ("AllowDirectLogIn",YN,1); - DegTyp->AllowDirectLogIn = (Str_ConvertToUpperLetter (YN[0]) == 'Y'); - } - else - DegTyp->AllowDirectLogIn = true; - - /***** Update table of degree types *****/ - sprintf (Query,"UPDATE deg_types SET AllowDirectLogIn='%c' WHERE DegTypCod='%ld'", - DegTyp->AllowDirectLogIn ? 'Y' : - 'N', - DegTyp->DegTypCod); - DB_QueryUPDATE (Query,"can not update the type of log in for a degree type"); - - /***** Write message to show the change made *****/ - sprintf (Gbl.Message, - DegTyp->AllowDirectLogIn ? Txt_The_type_of_degree_X_now_allows_direct_authentication : - Txt_The_type_of_degree_X_no_longer_allows_direct_authentication, - DegTyp->DegTypName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); - - /***** Show the form again *****/ - Deg_ReqEditDegreeTypes (); - } - /*****************************************************************************/ /************************ Change the type of a degree ************************/ /*****************************************************************************/ diff --git a/swad_degree.h b/swad_degree.h index fa4fb59b4..51ef881bc 100644 --- a/swad_degree.h +++ b/swad_degree.h @@ -84,7 +84,6 @@ struct DegreeType { long DegTypCod; // Degree type code char DegTypName[Deg_MAX_LENGTH_DEGREE_TYPE_NAME+1]; // Degree type name - bool AllowDirectLogIn; // Does this degree type allow direct log in? unsigned NumDegs; // Number of degrees of this type }; @@ -139,7 +138,6 @@ long Deg_GetInsCodOfDegreeByCod (long DegCod); void Deg_RenameDegreeType (void); void Deg_RenameDegreeShort (void); void Deg_RenameDegreeFull (void); -void Deg_ChangeDegTypeLogIn (void); void Deg_ChangeDegreeType (void); void Deg_ChangeDegreeCtr (void); void Deg_ChangeDegWWW (void); diff --git a/swad_global.c b/swad_global.c index 8e765a7b7..1ddab8922 100644 --- a/swad_global.c +++ b/swad_global.c @@ -225,10 +225,6 @@ void Gbl_InitializeGlobals (void) Gbl.CurrentDegTyp.DegTyp.DegTypCod = -1L; Gbl.CurrentDegTyp.DegTyp.DegTypName[0] = '\0'; - if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists - Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn = false; - else - Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn = true; Gbl.CurrentDeg.Deg.DegCod = -1L; Gbl.CurrentDeg.Deg.ShortName[0] = Gbl.CurrentDeg.Deg.FullName[0] = '\0'; @@ -301,9 +297,8 @@ void Gbl_InitializeGlobals (void) Gbl.Degs.AllDegs.Num = 0; Gbl.Degs.AllDegs.Lst = NULL; - Gbl.Degs.EditingDegTyp.DegTypCod = -1L; - Gbl.Degs.EditingDegTyp.DegTypName[0] = '\0'; - Gbl.Degs.EditingDegTyp.AllowDirectLogIn = true; + Gbl.Degs.EditingDegTyp.DegTypCod = -1L; + Gbl.Degs.EditingDegTyp.DegTypName[0] = '\0'; Gbl.Degs.EditingDeg.DegCod = -1L; Gbl.Degs.EditingDeg.ShortName[0] = '\0'; diff --git a/swad_layout.c b/swad_layout.c index ba6b2c044..7ab73f862 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -304,9 +304,6 @@ void Lay_WriteStartOfPage (void) /* Start of canvas: main zone for actions output */ fprintf (Gbl.F.Out,"
"); - /* Write warning when degree type does not allow direct login */ - Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (); - /* If it is mandatory to read any information about course */ if (Gbl.CurrentCrs.Info.ShowMsgMustBeRead) Inf_WriteMsgYouMustReadInfo (); diff --git a/swad_text.c b/swad_text.c index 5e6dd983b..6053831cc 100644 --- a/swad_text.c +++ b/swad_text.c @@ -7883,69 +7883,6 @@ const char *Txt_Details = "Detalhes"; #endif -const char *Txt_Direct_authentication = -#if L==1 - "¿Autenticació directa?"; -#elif L==2 - "Direkte Authentifizierung?"; -#elif L==3 - "Direct authentication?"; -#elif L==4 - "¿Autenticación directa?"; -#elif L==5 - "Authentification directe?"; -#elif L==6 - "¿Autenticación directa?"; // Okoteve traducción -#elif L==7 - "Autenticazione diretta?"; -#elif L==8 - "Bezpośredni uwierzytelniania?"; -#elif L==9 - "Autenticação direta?"; -#endif - -const char *Txt_Direct_authentication_allowed = -#if L==1 - "Autenticació directa permesa"; -#elif L==2 - "Direkte Authentifizierung erlaubt"; -#elif L==3 - "Direct authentication allowed"; -#elif L==4 - "Autenticación directa permitida"; -#elif L==5 - "Authentification directe autorisée"; -#elif L==6 - "Autenticación directa permitida"; // Okoteve traducción -#elif L==7 - "Autenticazione diretta permessa"; -#elif L==8 - "Bezpośredni uwierzytelniania dozwolone"; -#elif L==9 - "Autenticação direta permitida"; -#endif - -const char *Txt_Direct_authentication_not_allowed = -#if L==1 - "Autenticació directa no permesa"; -#elif L==2 - "Direkte Authentifizierung nicht erlaubt"; -#elif L==3 - "Direct authentication not allowed"; -#elif L==4 - "Autenticación directa no permitida"; -#elif L==5 - "Authentification directe n'est pas autorisée"; -#elif L==6 - "Autenticación directa no permitida"; // Okoteve traducción -#elif L==7 - "Autenticazione diretta non permessa"; -#elif L==8 - "Bezpośredni uwierzytelniania nie dozwolone"; -#elif L==9 - "Autenticação direta não permitida"; -#endif - const char *Txt_Disclaimer_the_files_hosted_here_ = // Warning: it is very important to include two %s in the following sentences #if L==1 "Aviso legal: los archivos alojados aquí, salvo que se indique lo contrario," @@ -38370,69 +38307,6 @@ const char *Txt_students_ABBREVIATION = // Abbreviation of "students" "estu."; #endif -const char *Txt_Students_authentication = -#if L==1 - "Autenticació
d'estudiants"; -#elif L==2 - "Studenten-
Authentifizierung"; -#elif L==3 - "Students'
authentication"; -#elif L==4 - "Autenticación
de estudiantes"; -#elif L==5 - "Authentification des étudiants"; -#elif L==6 - "Autenticación
de estudiantes"; // Okoteve traducción -#elif L==7 - "Autenticazione degli studenti"; -#elif L==8 - "Uwierzytelnianie studentów"; -#elif L==9 - "Autenticação de estudantes"; -#endif - -const char *Txt_STUDENTS_may_enter_directly = -#if L==1 - "poden entrar directament"; -#elif L==2 - "können direkt eingeben"; -#elif L==3 - "may enter directly"; -#elif L==4 - "pueden entrar directamente"; -#elif L==5 - "peuvent entrer directement"; -#elif L==6 - "pueden entrar directamente"; // Okoteve traducción -#elif L==7 - "possono entrare direttamente"; -#elif L==8 - "moga wejść bezpośrednio"; -#elif L==9 - "podem entrar diretamente"; -#endif - -const char *Txt_STUDENTS_must_enter_through_X = // Warning: it is very important to include %s in the following sentences -#if L==1 - "han d'entrar per %s"; -#elif L==2 - "müssen durch %s eingeben"; -#elif L==3 - "must enter through %s"; -#elif L==4 - "deben entrar por %s"; -#elif L==5 - "doivent entrer par %s"; -#elif L==6 - "deben entrar por %s"; // Okoteve traducción -#elif L==7 - "devono entrare attraverso %s"; -#elif L==8 - "muszą wejść przez %s"; -#elif L==9 - "devem entrar através %s"; -#endif - const char *Txt_Student_record_card_in_this_course_has_been_updated = #if L==1 "La ficha del estudiante en la asignatura se ha actualizado."; // Necessita traduccio @@ -43863,48 +43737,6 @@ const char *Txt_The_type_of_degree_X_has_been_renamed_as_Y = // Warning: it is v "The type of degree %s has been renamed as %s."; // Necessita de tradução #endif -const char *Txt_The_type_of_degree_X_no_longer_allows_direct_authentication = // Warning: it is very important to include %s in the following sentences -#if L==1 - "El tipus de titulació %s ja no permet autenticació directa."; -#elif L==2 - "The type of degree %s no longer allows direct authentication."; // Need Übersetzung -#elif L==3 - "The type of degree %s no longer allows direct authentication."; -#elif L==4 - "El tipo de titulación %s ya no permite autenticación directa."; -#elif L==5 - "The type of degree %s no longer allows direct authentication."; // Besoin de traduction -#elif L==6 - "El tipo de titulación %s ya no permite autenticación directa."; // Okoteve traducción -#elif L==7 - "Il tipo di laurea %s non permette più ora l'autenticazione diretta."; -#elif L==8 - "The type of degree %s no longer allows direct authentication."; // Potrzebujesz tlumaczenie -#elif L==9 - "The type of degree %s no longer allows direct authentication."; // Necessita de tradução -#endif - -const char *Txt_The_type_of_degree_X_now_allows_direct_authentication = // Warning: it is very important to include %s in the following sentences -#if L==1 - "El tipus de titulació %s ara permet autenticació directa."; -#elif L==2 - "The type of degree %s now allows direct authentication."; // Need Übersetzung -#elif L==3 - "The type of degree %s now allows direct authentication."; -#elif L==4 - "El tipo de titulación %s ahora permite autenticación directa."; -#elif L==5 - "The type of degree %s now allows direct authentication."; // Besoin de traduction -#elif L==6 - "El tipo de titulación %s ahora permite autenticación directa."; // Okoteve traducción -#elif L==7 - "Il tipo di laurea %s permette ora l'autenticazione diretta."; -#elif L==8 - "The type of degree %s now allows direct authentication."; // Potrzebujesz tlumaczenie -#elif L==9 - "The type of degree %s now allows direct authentication."; // Necessita de tradução -#endif - const char *Txt_The_type_of_degree_of_the_degree_X_has_changed = // Warning: it is very important to include %s in the following sentences #if L==1 "El tipo de titulación de la titulación %s ha cambiado."; // Necessita traduccio @@ -45675,54 +45507,6 @@ const char *Txt_There_was_an_error_in_assessing_the_test_X = // Warning: it is v "There was an error in assessing the test %u."; // Necessita de tradução #endif -const char *Txt_This_course_requires_log_in_from_X_to_have_full_functionality_ = // Warning: it is very important to include four %s in the following sentences -#if L==1 - "Esta asignatura requiere entrar" - " desde %s" - " para disfrutar de la funcionalidad completa." - " Por favor, entre desde %s."; // Necessita traduccio -#elif L==2 - "This course requires log in" - " from %s" - " to have full functionality." - " Please log in from %s."; // Need Übersetzung -#elif L==3 - "This course requires log in" - " from %s" - " to have full functionality." - " Please log in from %s."; -#elif L==4 - "Esta asignatura requiere entrar" - " desde %s" - " para disfrutar de la funcionalidad completa." - " Por favor, entre desde %s."; -#elif L==5 - "This course requires log in" - " from %s" - " to have full functionality." - " Please log in from %s."; // Besoin de traduction -#elif L==6 - "This course requires log in" - " from %s" - " to have full functionality." - " Please log in from %s."; // Okoteve traducción -#elif L==7 - "This course requires log in" - " from %s" - " to have full functionality." - " Please log in from %s."; // Bisogno di traduzione -#elif L==8 - "This course requires log in" - " from %s" - " to have full functionality." - " Please log in from %s."; // Potrzebujesz tlumaczenie -#elif L==9 - "This course requires log in" - " from %s" - " to have full functionality." - " Please log in from %s."; // Necessita de tradução -#endif - const char *Txt_this_field_is_filled_in_the_record_of_one_student = #if L==1 " (dicho campo está relleno en la ficha de un estudiante)"; // Necessita traduccio diff --git a/swad_user.c b/swad_user.c index 6f466f5ee..168356e26 100644 --- a/swad_user.c +++ b/swad_user.c @@ -2581,15 +2581,7 @@ static void Usr_SetUsrRoleAndPrefs (void) if (Gbl.CurrentCrs.Crs.CrsCod > 0) { if (Gbl.Usrs.Me.IBelongToCurrentCrs) - { - if (Gbl.Imported.ExternalRole == Rol_UNKNOWN && // I logged in directly, not from external service... - Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT && // ...and I am a student in the current course... - !Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn && // ...but the current degree type... - !Gbl.CurrentCrs.Crs.AllowDirectLogIn) // ...and the current course do not allow to log in directly - Gbl.Usrs.Me.AvailableRoles = (1 << Rol_VISITOR); // In this case, my role will be visitor, and an alert will be shown - else - Gbl.Usrs.Me.AvailableRoles = (1 << Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB); - } + Gbl.Usrs.Me.AvailableRoles = (1 << Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB); else if (Gbl.Usrs.Me.MaxRole >= Rol_STUDENT) Gbl.Usrs.Me.AvailableRoles = (1 << Rol_VISITOR); else @@ -2616,40 +2608,6 @@ static void Usr_SetUsrRoleAndPrefs (void) break; } -/*****************************************************************************/ -/******** Write warning when degree type does not allow direct login *********/ -/*****************************************************************************/ -/* -When is forbidden direct log in? - Gbl.CurrentCrs.Crs.AllowDirectLogIn - false true - false forbidden allowed -Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn - true allowed allowed -*/ - -void Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (void) - { - extern const char *Txt_This_course_requires_log_in_from_X_to_have_full_functionality_; - - if (Cfg_EXTERNAL_LOGIN_URL[0] && Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) - /* If I belong to current course but my role in current course is visitor, show alert */ - if (Gbl.Usrs.Me.IBelongToCurrentCrs && - Gbl.Imported.ExternalRole == Rol_UNKNOWN && // I logged in directly, not from external service... - Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT && // ...and I am a student in the current course... - !Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn && // ...but the current degree type... - !Gbl.CurrentCrs.Crs.AllowDirectLogIn && // ...and the current course do not allow to log in directly - (Gbl.Action.Act == ActSeeCrsInf || - Gbl.Action.Act == ActAutUsrInt || - Gbl.Action.Act == ActHom)) - { - sprintf (Gbl.Message,Txt_This_course_requires_log_in_from_X_to_have_full_functionality_, - Cfg_EXTERNAL_LOGIN_URL,Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME, - Cfg_EXTERNAL_LOGIN_URL,Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); - } - } - /*****************************************************************************/ /************** Show forms to log out and to change my role ******************/ /*****************************************************************************/ diff --git a/swad_user.h b/swad_user.h index 2a6192c4e..1b71a3c5e 100644 --- a/swad_user.h +++ b/swad_user.h @@ -265,7 +265,6 @@ bool Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (void); void Usr_ChkUsrAndGetUsrData (void); -void Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (void); void Usr_ShowFormsLogoutAndRole (void); bool Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (struct UsrData *UsrDat);