Version 15.144

This commit is contained in:
Antonio Cañas Vargas 2016-03-03 01:10:54 +01:00
parent 1d2c540258
commit 09e9d53a02
14 changed files with 81 additions and 583 deletions

View File

@ -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

View File

@ -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

View File

@ -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 ********************************/

View File

@ -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)

View File

@ -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,"<tr>"
"<td class=\"%s RIGHT_MIDDLE\">"
@ -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,"<tr>"
"<td class=\"%s RIGHT_MIDDLE\">"
"%s:"
"</td>"
"<td class=\"LEFT_MIDDLE\">",
The_ClassForm[Gbl.Prefs.Theme],
Txt_Students_authentication);
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"AllowDirectLogIn\" value=\"N\"");
if (!Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn &&
!Gbl.CurrentCrs.Crs.AllowDirectLogIn)
fprintf (Gbl.F.Out," checked=\"checked\"");
if (!IsForm || Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out," /><span class=\"DAT\">");
fprintf (Gbl.F.Out,Txt_STUDENTS_must_enter_through_X,
Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME);
fprintf (Gbl.F.Out,"<br /></span>");
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"AllowDirectLogIn\" value=\"Y\"");
if (Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn ||
Gbl.CurrentCrs.Crs.AllowDirectLogIn)
fprintf (Gbl.F.Out," checked=\"checked\"");
if (!IsForm || Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out," /><span class=\"DAT\">%s</span>",
Txt_STUDENTS_may_enter_directly);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
/*****************************************************************************/
/******************** 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.");

View File

@ -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

View File

@ -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 *****/

View File

@ -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)
"</td>",
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,"<td class=\"CENTER_MIDDLE %s\">"
"<img src=\"%s/%s16x16.gif\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</td>",
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,"<td class=\"DAT CENTER_MIDDLE %s\">"
"%u"
@ -1269,21 +1251,6 @@ static void Deg_ListDegreeTypesForEdition (void)
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>");
/* 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,"<td class=\"CENTER_MIDDLE\">");
Act_FormStart (ActChgDegTypLog);
Deg_PutParamOtherDegTypCod (Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypCod);
fprintf (Gbl.F.Out,"<input type=\"checkbox\" name=\"AllowDirectLogIn\" value=\"Y\"%s"
" onchange=\"document.getElementById('%s').submit();\" />",
Gbl.Degs.DegTypes.Lst[NumDegTyp].AllowDirectLogIn ? " checked=\"checked\"" :
"",
Gbl.Form.Id);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>");
}
/* Number of degrees of this type */
fprintf (Gbl.F.Out,"<td class=\"DAT CENTER_MIDDLE\">"
"%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,"<tr>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>",
"</th>"
"</tr>",
Txt_Type_of_BR_degree);
if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists
fprintf (Gbl.F.Out,"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>",
Txt_Direct_authentication);
fprintf (Gbl.F.Out,"</tr>");
/***** Degree type name *****/
fprintf (Gbl.F.Out,"<tr>"
@ -1727,17 +1688,6 @@ static void Deg_PutFormToCreateDegType (void)
"</td>",
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,"<td class=\"CENTER_MIDDLE\">"
"<input type=\"checkbox\" name=\"AllowDirectLogIn\" value=\"Y\"%s />"
"</td>"
"<td></td>"
"</tr>",
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,"<tr>"
"<th class=\"BM\"></th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>",
Txt_Type_of_BR_degree);
if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists
fprintf (Gbl.F.Out,"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>",
Txt_Direct_authentication);
fprintf (Gbl.F.Out,"<th class=\"RIGHT_MIDDLE\">"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"</tr>",
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,"<tr>"
@ -1918,19 +1861,13 @@ static void Deg_PutHeadDegreeTypesForEdition (void)
"</th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>",
Txt_Code,
Txt_Type_of_BR_degree);
if (Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME[0]) // If external login service exists
fprintf (Gbl.F.Out,"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>"
"</tr>",
Txt_Direct_authentication);
fprintf (Gbl.F.Out,"<th class=\"RIGHT_MIDDLE\">"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"</tr>",
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 ************************/
/*****************************************************************************/

View File

@ -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);

View File

@ -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';

View File

@ -304,9 +304,6 @@ void Lay_WriteStartOfPage (void)
/* Start of canvas: main zone for actions output */
fprintf (Gbl.F.Out,"<div class=\"MAIN_ZONE_CANVAS\">");
/* 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 ();

View File

@ -7883,69 +7883,6 @@ const char *Txt_Details =
"Detalhes";
#endif
const char *Txt_Direct_authentication =
#if L==1
"&iquest;Autenticaci&oacute; directa?";
#elif L==2
"Direkte Authentifizierung?";
#elif L==3
"Direct authentication?";
#elif L==4
"&iquest;Autenticaci&oacute;n directa?";
#elif L==5
"Authentification directe?";
#elif L==6
"&iquest;Autenticaci&oacute;n directa?"; // Okoteve traducción
#elif L==7
"Autenticazione diretta?";
#elif L==8
"Bezpo&sacute;redni uwierzytelniania?";
#elif L==9
"Autentica&ccedil;&atilde;o direta?";
#endif
const char *Txt_Direct_authentication_allowed =
#if L==1
"Autenticaci&oacute; directa permesa";
#elif L==2
"Direkte Authentifizierung erlaubt";
#elif L==3
"Direct authentication allowed";
#elif L==4
"Autenticaci&oacute;n directa permitida";
#elif L==5
"Authentification directe autoris&eacute;e";
#elif L==6
"Autenticaci&oacute;n directa permitida"; // Okoteve traducción
#elif L==7
"Autenticazione diretta permessa";
#elif L==8
"Bezpo&sacute;redni uwierzytelniania dozwolone";
#elif L==9
"Autentica&ccedil;&atilde;o direta permitida";
#endif
const char *Txt_Direct_authentication_not_allowed =
#if L==1
"Autenticaci&oacute; directa no permesa";
#elif L==2
"Direkte Authentifizierung nicht erlaubt";
#elif L==3
"Direct authentication not allowed";
#elif L==4
"Autenticaci&oacute;n directa no permitida";
#elif L==5
"Authentification directe n'est pas autoris&eacute;e";
#elif L==6
"Autenticaci&oacute;n directa no permitida"; // Okoteve traducción
#elif L==7
"Autenticazione diretta non permessa";
#elif L==8
"Bezpo&sacute;redni uwierzytelniania nie dozwolone";
#elif L==9
"Autentica&ccedil;&atilde;o direta n&atilde;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&iacute;, 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&oacute;<br />d'estudiants";
#elif L==2
"Studenten-<br />Authentifizierung";
#elif L==3
"Students'<br />authentication";
#elif L==4
"Autenticaci&oacute;n<br />de estudiantes";
#elif L==5
"Authentification des &eacute;tudiants";
#elif L==6
"Autenticaci&oacute;n<br />de estudiantes"; // Okoteve traducción
#elif L==7
"Autenticazione degli studenti";
#elif L==8
"Uwierzytelnianie student&oacute;w";
#elif L==9
"Autentica&ccedil;&atilde;o de estudantes";
#endif
const char *Txt_STUDENTS_may_enter_directly =
#if L==1
"poden entrar directament";
#elif L==2
"k&ouml;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&sacute;&cacute; bezpo&sacute;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&uuml;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&aogon; wej&sacute;&cacute; przez %s";
#elif L==9
"devem entrar atrav&eacute;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 <strong>%s</strong> has been renamed as <strong>%s</strong>."; // 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&oacute; <strong>%s</strong> ja no permet autenticaci&oacute; directa.";
#elif L==2
"The type of degree <strong>%s</strong> no longer allows direct authentication."; // Need Übersetzung
#elif L==3
"The type of degree <strong>%s</strong> no longer allows direct authentication.";
#elif L==4
"El tipo de titulaci&oacute;n <strong>%s</strong> ya no permite autenticaci&oacute;n directa.";
#elif L==5
"The type of degree <strong>%s</strong> no longer allows direct authentication."; // Besoin de traduction
#elif L==6
"El tipo de titulaci&oacute;n <strong>%s</strong> ya no permite autenticaci&oacute;n directa."; // Okoteve traducción
#elif L==7
"Il tipo di laurea <strong>%s</strong> non permette pi&ugrave; ora l'autenticazione diretta.";
#elif L==8
"The type of degree <strong>%s</strong> no longer allows direct authentication."; // Potrzebujesz tlumaczenie
#elif L==9
"The type of degree <strong>%s</strong> 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&oacute; <strong>%s</strong> ara permet autenticaci&oacute; directa.";
#elif L==2
"The type of degree <strong>%s</strong> now allows direct authentication."; // Need Übersetzung
#elif L==3
"The type of degree <strong>%s</strong> now allows direct authentication.";
#elif L==4
"El tipo de titulaci&oacute;n <strong>%s</strong> ahora permite autenticaci&oacute;n directa.";
#elif L==5
"The type of degree <strong>%s</strong> now allows direct authentication."; // Besoin de traduction
#elif L==6
"El tipo de titulaci&oacute;n <strong>%s</strong> ahora permite autenticaci&oacute;n directa."; // Okoteve traducción
#elif L==7
"Il tipo di laurea <strong>%s</strong> permette ora l'autenticazione diretta.";
#elif L==8
"The type of degree <strong>%s</strong> now allows direct authentication."; // Potrzebujesz tlumaczenie
#elif L==9
"The type of degree <strong>%s</strong> 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&oacute;n de la titulaci&oacute;n <strong>%s</strong> 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 <a href=\"%s\" target=\"_blank\">%s</a>"
" para disfrutar de la funcionalidad completa."
" Por favor, entre desde <a href=\"%s\" target=\"_blank\">%s</a>."; // Necessita traduccio
#elif L==2
"This course requires log in"
" from <a href=\"%s\" target=\"_blank\">%s</a>"
" to have full functionality."
" Please log in from <a href=\"%s\" target=\"_blank\">%s</a>."; // Need Übersetzung
#elif L==3
"This course requires log in"
" from <a href=\"%s\" target=\"_blank\">%s</a>"
" to have full functionality."
" Please log in from <a href=\"%s\" target=\"_blank\">%s</a>.";
#elif L==4
"Esta asignatura requiere entrar"
" desde <a href=\"%s\" target=\"_blank\">%s</a>"
" para disfrutar de la funcionalidad completa."
" Por favor, entre desde <a href=\"%s\" target=\"_blank\">%s</a>.";
#elif L==5
"This course requires log in"
" from <a href=\"%s\" target=\"_blank\">%s</a>"
" to have full functionality."
" Please log in from <a href=\"%s\" target=\"_blank\">%s</a>."; // Besoin de traduction
#elif L==6
"This course requires log in"
" from <a href=\"%s\" target=\"_blank\">%s</a>"
" to have full functionality."
" Please log in from <a href=\"%s\" target=\"_blank\">%s</a>."; // Okoteve traducción
#elif L==7
"This course requires log in"
" from <a href=\"%s\" target=\"_blank\">%s</a>"
" to have full functionality."
" Please log in from <a href=\"%s\" target=\"_blank\">%s</a>."; // Bisogno di traduzione
#elif L==8
"This course requires log in"
" from <a href=\"%s\" target=\"_blank\">%s</a>"
" to have full functionality."
" Please log in from <a href=\"%s\" target=\"_blank\">%s</a>."; // Potrzebujesz tlumaczenie
#elif L==9
"This course requires log in"
" from <a href=\"%s\" target=\"_blank\">%s</a>"
" to have full functionality."
" Please log in from <a href=\"%s\" target=\"_blank\">%s</a>."; // Necessita de tradução
#endif
const char *Txt_this_field_is_filled_in_the_record_of_one_student =
#if L==1
" (dicho campo est&aacute; relleno en la ficha de un estudiante)"; // Necessita traduccio

View File

@ -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 ******************/
/*****************************************************************************/

View File

@ -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);