Version 15.160

This commit is contained in:
Antonio Cañas Vargas 2016-03-21 19:52:40 +01:00
parent 793aabb27d
commit 30ba842422
8 changed files with 103 additions and 2471 deletions

File diff suppressed because it is too large Load Diff

View File

@ -121,19 +121,10 @@ void Acc_ShowFormAccount (void)
Pre_PutLinkToChangeLanguage ();
fprintf (Gbl.F.Out,"</div>");
Acc_ShowFormRequestNewAccount ();
Acc_ShowFormRequestNewAccountWithParams ("","");
}
}
/*****************************************************************************/
/********************* Show form to create a new account *********************/
/*****************************************************************************/
void Acc_ShowFormRequestNewAccount (void)
{
Acc_ShowFormRequestNewAccountWithParams ("","");
}
/*****************************************************************************/
/************ Show form to create a new account using parameters *************/
/*****************************************************************************/
@ -201,6 +192,28 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith
Act_FormEnd ();
}
/*****************************************************************************/
/********* Show form to go to request the creation of a new account **********/
/*****************************************************************************/
void Acc_ShowFormGoToRequestNewAccount (void)
{
extern const char *Txt_New_on_PLATFORM_Sign_up;
extern const char *Txt_Create_new_account;
/***** Start frame *****/
sprintf (Gbl.Title,Txt_New_on_PLATFORM_Sign_up,Cfg_PLATFORM_SHORT_NAME);
Lay_StartRoundFrame (NULL,Gbl.Title,NULL);
/***** Button to go to request the creation of a new account *****/
Act_FormStart (ActFrmUsrAcc);
Lay_PutCreateButton (Txt_Create_new_account);
Act_FormEnd ();
/***** End frame *****/
Lay_EndRoundFrame ();
}
/*****************************************************************************/
/*********************** Show form to change my account **********************/
/*****************************************************************************/
@ -356,15 +369,19 @@ static bool Acc_GetParamsNewAccount (char *NewNicknameWithoutArroba,
/***** Step 1/3: Get new nickname from form *****/
Par_GetParToText ("NewNick",NewNicknameWithArroba,Nck_MAX_BYTES_NICKNAME_WITH_ARROBA);
/* Remove arrobas at the beginning */
strncpy (NewNicknameWithoutArroba,NewNicknameWithArroba,Nck_MAX_BYTES_NICKNAME_WITH_ARROBA);
NewNicknameWithoutArroba[Nck_MAX_BYTES_NICKNAME_WITH_ARROBA] = '\0';
Str_RemoveLeadingArrobas (NewNicknameWithoutArroba);
/* Create a new version of the nickname with arroba */
sprintf (NewNicknameWithArroba,"@%s",NewNicknameWithoutArroba);
if (Nck_CheckIfNickWithArrobaIsValid (NewNicknameWithArroba)) // If new nickname is valid
{
/***** Remove arrobas at the beginning *****/
Str_RemoveLeadingArrobas (NewNicknameWithoutArroba);
/***** Check if the new nickname matches any of the nicknames of other users *****/
/* Check if the new nickname
matches any of the nicknames of other users */
sprintf (Query,"SELECT COUNT(*) FROM usr_nicknames"
" WHERE Nickname='%s' AND UsrCod<>'%ld'",
NewNicknameWithoutArroba,Gbl.Usrs.Me.UsrDat.UsrCod);
@ -391,7 +408,8 @@ static bool Acc_GetParamsNewAccount (char *NewNicknameWithoutArroba,
if (Mai_CheckIfEmailIsValid (NewEmail)) // New e-mail is valid
{
/***** Check if the new e-mail matches any of the confirmed e-mails of other users *****/
/* Check if the new e-mail matches
any of the confirmed e-mails of other users */
sprintf (Query,"SELECT COUNT(*) FROM usr_emails"
" WHERE E_mail='%s' AND Confirmed='Y'",
NewEmail);

View File

@ -46,7 +46,7 @@
void Acc_PutLinkToCreateAccount (void);
void Acc_ShowFormAccount (void);
void Acc_ShowFormRequestNewAccount (void);
void Acc_ShowFormGoToRequestNewAccount (void);
void Acc_ShowFormChangeMyAccount (void);
bool Acc_CreateNewAccountAndLogIn (void);
void Acc_CreateNewUsr (struct UsrData *UsrDat);

View File

@ -134,13 +134,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.159.5 (2016-03-21)"
#define CSS_FILE "swad15.159.5.css"
#define Log_PLATFORM_VERSION "SWAD 15.160 (2016-03-21)"
#define CSS_FILE "swad15.160.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.160: Mar 21, 2016 Changes in forms to login and to create new account. (196423 lines)
Version 15.159.5: Mar 21, 2016 Changes in CSS related to tables. (196423 lines)
Version 15.159.4: Mar 21, 2016 Icon to print stats on degrees integrated in frame. (196426 lines)
Version 15.159.3: Mar 21, 2016 Icon to add new announcement integrated in frame.

View File

@ -1425,12 +1425,12 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
{
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (UsrDat.UsrIDNickOrEmail);
Str_ConvertToUpperText (UsrDat.UsrIDNickOrEmail);
if (ID_CheckIfUsrIDSeemsAValidID (UsrDat.UsrIDNickOrEmail))
{
/***** Find users for this user's ID *****/
ID_ReallocateListIDs (&UsrDat,1); // Only one user's ID
strcpy (UsrDat.IDs.List[0].ID,UsrDat.UsrIDNickOrEmail);
Str_ConvertToUpperText (UsrDat.IDs.List[0].ID);
ID_GetListUsrCodsFromUsrID (&UsrDat,NULL,&ListUsrCods,false);
}
}
@ -1567,7 +1567,6 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
{
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (UsrDat.UsrIDNickOrEmail);
Str_ConvertToUpperText (UsrDat.UsrIDNickOrEmail);
if (ID_CheckIfUsrIDSeemsAValidID (UsrDat.UsrIDNickOrEmail))
{
ItLooksLikeAUsrID = true;
@ -1575,6 +1574,7 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
/* Find users for this user's ID */
ID_ReallocateListIDs (&UsrDat,1); // Only one user's ID
strcpy (UsrDat.IDs.List[0].ID,UsrDat.UsrIDNickOrEmail);
Str_ConvertToUpperText (UsrDat.IDs.List[0].ID);
ID_GetListUsrCodsFromUsrID (&UsrDat,NULL,&ListUsrCods,false);
}
}

View File

@ -316,7 +316,6 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
{
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
Str_ConvertToUpperText (Gbl.Usrs.Me.UsrIdLogin);
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Me.UsrIdLogin))
{
/***** Allocate space for the list *****/
@ -324,6 +323,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
// User has typed a user's ID
strcpy (Gbl.Usrs.Me.UsrDat.IDs.List[0].ID,Gbl.Usrs.Me.UsrIdLogin);
Str_ConvertToUpperText (Gbl.Usrs.Me.UsrDat.IDs.List[0].ID);
/* Get users' codes for this ID */
if (!ID_GetListUsrCodsFromUsrID (&Gbl.Usrs.Me.UsrDat,NULL,&ListUsrCods,true)) // Only confirmed IDs

View File

@ -5702,7 +5702,7 @@ const char *Txt_Create_account =
#elif L==7
"Registrati";
#elif L==8
"Za&lstrok;&oacute;&zdot; nowe konto";
"Za&lstrok;&oacute;&zdot; konto";
#elif L==9
"Criar conta";
#endif
@ -6127,6 +6127,27 @@ const char *Txt_Create_mail_domain =
"Criar dom&iacute;nio de email";
#endif
const char *Txt_Create_new_account =
#if L==1
"Crear nou compte";
#elif L==2
"Neuen Account erstellen";
#elif L==3
"Create new account";
#elif L==4
"Crear nueva cuenta";
#elif L==5
"Cr&eacute;er un nouveau compte";
#elif L==6
"Crear nueva cuenta"; // Okoteve traducción
#elif L==7
"Crea nuovo account";
#elif L==8
"Za&lstrok;&oacute;&zdot; nowe konto";
#elif L==9
"Criar nova conta";
#endif
const char *Txt_Create_notice =
#if L==1
"Crear av&iacute;s";
@ -23337,7 +23358,7 @@ const char *Txt_Nickname =
#elif L==6
"Apodo"; // Okoteve traducción
#elif L==7
"Nome utente";
"Nome-utente";
#elif L==8
"Pseudonim";
#elif L==9
@ -42832,67 +42853,49 @@ const char *Txt_The_new_logo_is_X = // Warning: it is very important to include
const char *Txt_The_nickname_entered_X_is_not_valid_ = // Warning: it is very important to include %s and two %u in the following sentences
#if L==1
"El apodo introducido"
" <strong>%s</strong> no es v&aacute;lido.<br />"
"El apodo debe comenzar por @"
" y tener una longitud entre %u y %u caracteres (sin contar la @).<br />"
"Cada car&aacute;cter puede ser una letra (a-z, A-Z),"
"El apodo <strong>%s</strong> no es v&aacute;lido.<br />"
"El apodo debe tener una longitud entre %u y %u caracteres (sin contar la @ inicial).<br />"
"Cada car&aacute;cter posterior a la @ inicial puede ser una letra (a-z, A-Z),"
" un d&iacute;gito (0-9) o &quot;_&quot;."; // Necessita traduccio
#elif L==2
"The nickname entered"
" <strong>%s</strong> is not valid.<br />"
"Your nickname must start with @"
" and must have a length between %u and %u characters (not including the @).<br />"
"Each character can be a letter (a-z, A-Z),"
"The nickname <strong>%s</strong> is not valid.<br />"
"Your nickname must have a length between %u and %u characters (not including the initial @).<br />"
"Each character after initial @ can be a letter (a-z, A-Z),"
" a digit (0-9) or &quot;_&quot;."; // Need Übersetzung
#elif L==3
"The nickname entered"
" <strong>%s</strong> is not valid.<br />"
"Your nickname must start with @"
" and must have a length between %u and %u characters (not including the @).<br />"
"Each character can be a letter (a-z, A-Z),"
"The nickname <strong>%s</strong> is not valid.<br />"
"Your nickname must have a length between %u and %u characters (not including the initial @).<br />"
"Each character after initial @ can be a letter (a-z, A-Z),"
" a digit (0-9) or &quot;_&quot;.";
#elif L==4
"El apodo introducido"
" <strong>%s</strong> no es v&aacute;lido.<br />"
"El apodo debe comenzar por @"
" y tener una longitud entre %u y %u caracteres (sin contar la @).<br />"
"Cada car&aacute;cter puede ser una letra (a-z, A-Z),"
"El apodo <strong>%s</strong> no es v&aacute;lido.<br />"
"El apodo debe tener una longitud entre %u y %u caracteres (sin contar la @ inicial).<br />"
"Cada car&aacute;cter posterior a la @ inicial puede ser una letra (a-z, A-Z),"
" un d&iacute;gito (0-9) o &quot;_&quot;.";
#elif L==5
"The nickname entered"
" <strong>%s</strong> is not valid.<br />"
"Your nickname must start with @"
" and must have a length between %u and %u characters (not including the @).<br />"
"Each character can be a letter (a-z, A-Z),"
"The nickname <strong>%s</strong> is not valid.<br />"
"Your nickname must have a length between %u and %u characters (not including initial the @).<br />"
"Each character after initial @ can be a letter (a-z, A-Z),"
" a digit (0-9) or &quot;_&quot;."; // Besoin de traduction
#elif L==6
"El apodo introducido"
" <strong>%s</strong> no es v&aacute;lido.<br />"
"El apodo debe comenzar por @"
" y tener una longitud entre %u y %u caracteres (sin contar la @).<br />"
"Cada car&aacute;cter puede ser una letra (a-z, A-Z),"
"El apodo <strong>%s</strong> no es v&aacute;lido.<br />"
"El apodo debe tener una longitud entre %u y %u caracteres (sin contar la @ inicial).<br />"
"Cada car&aacute;cter posterior a la @ inicial puede ser una letra (a-z, A-Z),"
" un d&iacute;gito (0-9) o &quot;_&quot;."; // Okoteve traducción
#elif L==7
"Il nome utente immesso"
" <strong>%s</strong> non &egrave; valido.<br />"
"Your nickname must start with @"
" and must have a length between %u and %u characters (not including the @).<br /> "
"Each character can be a letter (a-z, A-Z),"
"Il nome utente <strong>%s</strong> non &egrave; valido.<br />"
"Your nickname must have a length between %u and %u characters (not including the initial @).<br /> "
"Each character after initial @ can be a letter (a-z, A-Z),"
" a digit (0-9) or &quot;_&quot;."; // Bisogno di traduzione
#elif L==8
"The nickname entered"
" <strong>%s</strong> is not valid.<br />"
"Your nickname must start with @"
" and must have a length between %u and %u characters (not including the @).<br />"
"Each character can be a letter (a-z, A-Z),"
"The nickname <strong>%s</strong> is not valid.<br />"
"Your nickname must have a length between %u and %u characters (not including the initial @).<br />"
"Each character after initial @ can be a letter (a-z, A-Z),"
" a digit (0-9) or &quot;_&quot;."; // Potrzebujesz tlumaczenie
#elif L==9
"The nickname entered"
" <strong>%s</strong> is not valid.<br />"
"Your nickname must start with @"
" and must have a length between %u and %u characters (not including the @).<br />"
"Each character can be a letter (a-z, A-Z),"
"The nickname <strong>%s</strong> is not valid.<br />"
"Your nickname must have a length between %u and %u characters (not including the initial @).<br />"
"Each character after initial @ can be a letter (a-z, A-Z),"
" a digit (0-9) or &quot;_&quot;."; // Necessita de tradução
#endif

View File

@ -1425,8 +1425,8 @@ void Usr_WriteLandingPage (void)
/***** Form to log in *****/
Usr_WriteFormLogin ();
/***** Form to create a new account *****/
Acc_ShowFormRequestNewAccount ();
/***** Form to go to request the creation of a new account *****/
Acc_ShowFormGoToRequestNewAccount ();
}
/*****************************************************************************/
@ -1468,8 +1468,7 @@ void Usr_PutLinkToLogin (void)
{
extern const char *Txt_Log_in;
Lay_PutContextualLink (ActFrmLogIn,NULL,
"login-green64x64.png",
Lay_PutContextualLink (ActFrmLogIn,NULL,"login-green64x64.png",
Txt_Log_in,Txt_Log_in);
}
@ -1764,7 +1763,7 @@ void Usr_GetParamUsrIdLogin (void)
Par_GetParToText ("UsrId",Gbl.Usrs.Me.UsrIdLogin,Usr_MAX_BYTES_USR_LOGIN);
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
Str_ConvertToUpperText (Gbl.Usrs.Me.UsrIdLogin);
// Str_ConvertToUpperText (Gbl.Usrs.Me.UsrIdLogin);
}
/*****************************************************************************/
@ -1781,7 +1780,7 @@ static void Usr_GetParamOtherUsrIDNickOrEMail (void)
{
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Str_ConvertToUpperText (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
// Str_ConvertToUpperText (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
}
}
@ -1828,20 +1827,17 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
{
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Str_ConvertToUpperText (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail))
{
if (strlen (Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail) <= ID_MAX_LENGTH_USR_ID)
{
/* Allocate space for the list */
ID_ReallocateListIDs (&Gbl.Usrs.Other.UsrDat,1);
/* Allocate space for the list */
ID_ReallocateListIDs (&Gbl.Usrs.Other.UsrDat,1);
strncpy (Gbl.Usrs.Other.UsrDat.IDs.List[0].ID,Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail,ID_MAX_LENGTH_USR_ID);
Gbl.Usrs.Other.UsrDat.IDs.List[0].ID[ID_MAX_LENGTH_USR_ID] = '\0';
strncpy (Gbl.Usrs.Other.UsrDat.IDs.List[0].ID,Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail,ID_MAX_LENGTH_USR_ID);
Gbl.Usrs.Other.UsrDat.IDs.List[0].ID[ID_MAX_LENGTH_USR_ID] = '\0';
Str_ConvertToUpperText (Gbl.Usrs.Other.UsrDat.IDs.List[0].ID);
/* Check if user's ID exists in database */
ID_GetListUsrCodsFromUsrID (&Gbl.Usrs.Other.UsrDat,NULL,ListUsrCods,false);
}
/* Check if user's ID exists in database */
ID_GetListUsrCodsFromUsrID (&Gbl.Usrs.Other.UsrDat,NULL,ListUsrCods,false);
}
else // Not a valid user's nickname, e-mail or ID
Wrong = true;
@ -2113,16 +2109,8 @@ static bool Usr_ChkUsrAndGetUsrDataFromDirectLogin (void)
{
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
Str_ConvertToUpperText (Gbl.Usrs.Me.UsrIdLogin);
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Me.UsrIdLogin))
{
// User is trying to log using his/her ID
if (strlen (Gbl.Usrs.Me.UsrIdLogin) > ID_MAX_LENGTH_USR_ID) // User's ID too long
{
Usr_ShowAlertUsrDoesNotExistsOrWrongPassword ();
return false;
}
/***** Allocate space for the list *****/
ID_ReallocateListIDs (&Gbl.Usrs.Me.UsrDat,1);
@ -2246,23 +2234,16 @@ static bool Usr_ChkUsrAndGetUsrDataFromExternalLogin (void)
Gbl.Usrs.Me.UsrIdLogin[Usr_MAX_BYTES_USR_LOGIN] = '\0';
// Users' IDs are always stored internally in capitals and without leading zeros
Str_RemoveLeadingZeros (Gbl.Usrs.Me.UsrIdLogin);
Str_ConvertToUpperText (Gbl.Usrs.Me.UsrIdLogin);
/***** Check if user's ID is valid *****/
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Me.UsrIdLogin))
{
// User is trying to log using his/her ID
if (strlen (Gbl.Usrs.Me.UsrIdLogin) > ID_MAX_LENGTH_USR_ID) // User's ID too long
{
Usr_ShowAlertUsrDoesNotExistsOrWrongPassword ();
return false;
}
/***** Allocate space for the list *****/
ID_ReallocateListIDs (&Gbl.Usrs.Me.UsrDat,1);
strncpy (Gbl.Usrs.Me.UsrDat.IDs.List[0].ID,Gbl.Usrs.Me.UsrIdLogin,ID_MAX_LENGTH_USR_ID);
Gbl.Usrs.Me.UsrDat.IDs.List[0].ID[ID_MAX_LENGTH_USR_ID] = '\0';
Str_ConvertToUpperText (Gbl.Usrs.Me.UsrDat.IDs.List[0].ID);
/* Check if user's ID exists in database, and get user's data */
if (ID_GetListUsrCodsFromUsrID (&Gbl.Usrs.Me.UsrDat,NULL,&ListUsrCods,true)) // Try first only confirmed IDs