From a3046315e2a9ae3401bae37e9a13ea9b09fe68ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 3 Dec 2014 20:06:16 +0100 Subject: [PATCH] Version 14.30.2 --- html/ws/index.html | 18 ++++---- soap/soapC.c | 2 +- soap/soapServer.c | 2 +- swad_ID.c | 4 +- swad_action.c | 9 ++-- swad_changelog.h | 4 +- swad_config.h | 16 +++++-- swad_text.c | 110 ++++++++++++++++++++++----------------------- swad_user.c | 86 ++++++++++------------------------- 9 files changed, 112 insertions(+), 139 deletions(-) diff --git a/html/ws/index.html b/html/ws/index.html index 093343bd1..fcbb76c45 100644 --- a/html/ws/index.html +++ b/html/ws/index.html @@ -617,26 +617,26 @@ img {border-width:0px; border-style:none;} <code>103482</code> <size>2026</size> <time>1334483747</time> - <license>CC by-nc-sa</license> - <publisher>Antonio Cañas Vargas</publisher> - <photo>http://openswad.org/swad/photo/nQwJwD6jYd.jpg</photo> + <license>CC by-nc-sa</license> + <publisher>Antonio Cañas Vargas</publisher> + <photo>http://openswad.org/swad/photo/nQwJwD6jYd.jpg</photo> </file> <file name="swad48x48.gif"> <code>103491</code> <size>1982</size> <time>1334483747</time> - <license>CC by-nc-sa</license> - <publisher>Antonio Cañas Vargas</publisher> - <photo>http://openswad.org/swad/photo/nQwJwD6jYd.jpg</photo> + <license>CC by-nc-sa</license> + <publisher>Antonio Cañas Vargas</publisher> + <photo>http://openswad.org/swad/photo/nQwJwD6jYd.jpg</photo> </file> </dir> <file name="Mejoras futuras.pdf"> <code>97910</code> <size>224595</size> <time>1334483747</time> - <license>CC by-nc-sa</license> - <publisher>Antonio Cañas Vargas</publisher> - <photo>http://openswad.org/swad/photo/nQwJwD6jYd.jpg</photo> + <license>CC by-nc-sa</license> + <publisher>Antonio Cañas Vargas</publisher> + <photo>http://openswad.org/swad/photo/nQwJwD6jYd.jpg</photo> </file> </tree> diff --git a/soap/soapC.c b/soap/soapC.c index 556df86eb..1dcde7d9d 100644 --- a/soap/soapC.c +++ b/soap/soapC.c @@ -19,7 +19,7 @@ compiling, linking, and/or using OpenSSL is allowed. extern "C" { #endif -SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.8.18 2014-12-02 19:38:46 GMT") +SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.8.18 2014-12-03 18:12:24 GMT") #ifndef WITH_NOGLOBAL diff --git a/soap/soapServer.c b/soap/soapServer.c index 55d613248..cb422d90a 100644 --- a/soap/soapServer.c +++ b/soap/soapServer.c @@ -17,7 +17,7 @@ compiling, linking, and/or using OpenSSL is allowed. extern "C" { #endif -SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.8.18 2014-12-02 19:38:46 GMT") +SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.8.18 2014-12-03 18:12:24 GMT") SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap) diff --git a/swad_ID.c b/swad_ID.c index fc665a89c..b6ae4fe21 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -608,8 +608,8 @@ static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe) if (UsrDat->IDs.Num < 2) // One unique ID ICanRemove = false; else if (ItsMe) - // I can remove my ID if it is not confirmed - ICanRemove = ID_CheckIfConfirmed (UsrDat->UsrCod,UsrID); + // I can remove my ID only if it is not confirmed + ICanRemove = !ID_CheckIfConfirmed (UsrDat->UsrCod,UsrID); else ICanRemove = true; diff --git a/swad_action.c b/swad_action.c index 392612201..15e983fda 100644 --- a/swad_action.c +++ b/swad_action.c @@ -3740,7 +3740,7 @@ void Act_AdjustActionWhenNoUsrLogged (void) else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected Gbl.CurrentAct = ActSeeCtyInf; else - Gbl.CurrentAct = ActFrmLogIn; + Gbl.CurrentAct = Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED; Lay_SetCurrentTab (); } @@ -3786,10 +3786,11 @@ void Act_AdjustCurrentAction (void) return; } - /***** If I have no e-mail or no nickname in database, + /***** If I have no nickname, e-mail or ID in database, the only action possible is show a form to change my account *****/ - if (!Gbl.Usrs.Me.UsrDat.Email[0] || - !Gbl.Usrs.Me.UsrDat.Nickname[0]) + if (!Gbl.Usrs.Me.UsrDat.Nickname[0] || + !Gbl.Usrs.Me.UsrDat.Email[0] || + !Gbl.Usrs.Me.UsrDat.IDs.Num) { switch (Gbl.CurrentAct) { diff --git a/swad_changelog.h b/swad_changelog.h index 0e711b17b..b99a7e7d0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -35,12 +35,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.30.1 (2014/11/30)" +#define Log_PLATFORM_VERSION "SWAD 14.30.2 (2014/12/03)" // 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 | tail -1 /* + Version 14.30.2 :Dic 03, 2014 Changes in sign up. + Fixed bug when deleting user's IDs. (170252 lines) Version 14.30.1 :Nov 30, 2014 Internal course code is shown in course configuration. (170275 lines) Version 14.30 :Nov 29, 2014 Database password and email password are moved from executable files to configuration files. (170248 lines) 1 change necessary in Makefile: diff --git a/swad_config.h b/swad_config.h index 5d6a47237..3d3f3fde0 100644 --- a/swad_config.h +++ b/swad_config.h @@ -37,15 +37,13 @@ /***************************** Public constants ******************************/ /*****************************************************************************/ -/* Platform name and server */ -#define Cfg_PLATFORM_SHORT_NAME "SWAD" -#define Cfg_PLATFORM_FULL_NAME "SWAD (Shared Workspace At a Distance)" - /* IMPORTANT: - If one of the following paths does not exist, it should be created during installation! */ #if defined LOCALHOST_UBUNTU // localhost (Ubuntu) ****************** +#define Cfg_PLATFORM_SHORT_NAME "SWAD" +#define Cfg_PLATFORM_FULL_NAME "SWAD (Shared Workspace At a Distance)" #define Cfg_PLATFORM_PAGE_TITLE "SWAD local" // This title will appear on browser top #define Cfg_PLATFORM_SERVER "localhost" // Server name (main part of the URL) #define Cfg_HTTP_SwAD_HOME_PAGE "http://localhost" // Without ending slash @@ -73,6 +71,7 @@ #define Cfg_ABOUT_LOGO_WIDTH 100 #define Cfg_ABOUT_LOGO_HEIGHT 32 +#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmUsrAcc #define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "" // Client of the web service called by this CGI #define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME "" #define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME "" @@ -88,6 +87,8 @@ #elif defined OPENSWAD_ORG // openswad.org ************************ +#define Cfg_PLATFORM_SHORT_NAME "OpenSWAD" +#define Cfg_PLATFORM_FULL_NAME "SWAD (Shared Workspace At a Distance)" #define Cfg_PLATFORM_PAGE_TITLE "OpenSWAD" // This title will appear on browser top #define Cfg_PLATFORM_SERVER "openswad.org" // Server name (main part of the URL) #define Cfg_HTTP_SwAD_HOME_PAGE "http://openswad.org/swad" // Without ending slash @@ -115,6 +116,7 @@ #define Cfg_ABOUT_LOGO_WIDTH 32 #define Cfg_ABOUT_LOGO_HEIGHT 32 +#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmUsrAcc #define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "" // Client of the web service called by this CGI #define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME "" #define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME "" @@ -147,6 +149,8 @@ #elif defined SWAD_UGR_ES // swad.ugr.es ************************* +#define Cfg_PLATFORM_SHORT_NAME "SWAD" +#define Cfg_PLATFORM_FULL_NAME "SWAD (Shared Workspace At a Distance)" #define Cfg_PLATFORM_PAGE_TITLE "SWAD UGR" // This title will appear on browser top #define Cfg_PLATFORM_SERVER "swad.ugr.es" // Server name (main part of the URL) #define Cfg_HTTP_SwAD_HOME_PAGE "http://swad.ugr.es/swad" // Without ending slash @@ -174,6 +178,7 @@ #define Cfg_ABOUT_LOGO_WIDTH 100 #define Cfg_ABOUT_LOGO_HEIGHT 32 +#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmLogIn #define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "./prado" // Client of the web service called by this CGI #define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME "PRADO" #define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME "PRADO (Plataforma de Recursos de Apoyo a la Docencia)" @@ -196,6 +201,8 @@ #elif defined WWW_CEVUNA_UNA_PY // www.cevuna.una.py/swad ****************** +#define Cfg_PLATFORM_SHORT_NAME "SWAD" +#define Cfg_PLATFORM_FULL_NAME "SWAD (Shared Workspace At a Distance)" #define Cfg_PLATFORM_PAGE_TITLE "SWAD UNA" // This title will appear on browser top #define Cfg_PLATFORM_SERVER "www.cevuna.una.py" // Server name (main part of the URL) #define Cfg_HTTP_SwAD_HOME_PAGE "http://www.cevuna.una.py/swad" // Without ending slash @@ -223,6 +230,7 @@ #define Cfg_ABOUT_LOGO_WIDTH 100 #define Cfg_ABOUT_LOGO_HEIGHT 32 +#define Cfg_DEFAULT_ACTION_WHEN_NO_USR_LOGGED ActFrmLogIn #define Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND "" // Client of the web service called by this CGI #define Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME "" #define Cfg_EXTERNAL_LOGIN_SERVICE_FULL_NAME "" diff --git a/swad_text.c b/swad_text.c index 1938ff587..00da05343 100644 --- a/swad_text.c +++ b/swad_text.c @@ -3221,6 +3221,36 @@ const char *Txt_Before_going_to_any_other_option_you_must_fill_your_email_addres " você deve preencher o seu endereço de e-mail."; #endif +const char *Txt_Before_going_to_any_other_option_you_must_fill_your_ID = +#if L==0 + "Abans d'accedir a qualsevol altra opció" + " ha de omplir el seu ID (DNI/cèdula)."; +#elif L==1 + "Bevor ich auf jede andere Option" + " müssen Sie Ihren Ausweis-Nr. änder."; +#elif L==2 + "Before going to any other option" + " you must fill your ID."; +#elif L==3 + "Antes de acceder a cualquier otra opción" + " debe rellenar su ID (DNI/cédula)."; +#elif L==4 + "Avant d'aller à une autre option" + " vous devez remplir votre ID."; +#elif L==5 + "Antes de acceder a cualquier otra opción" + " debe rellenar su ID (DNI/cédula)."; // Okoteve traducción +#elif L==6 + "Prima di scegliere qualsiasi altra opzione" + " devi compilare il tuo ID."; +#elif L==7 + "Zanim przejdziemy do innych opcji" + " nalezy w tym nick swoje zmień identyfikatory."; +#elif L==8 + "Antes de ir para qualquer outra opção" + " você deve preencher o seu nº. identif."; +#endif + const char *Txt_Before_going_to_any_other_option_you_must_fill_your_nickname = #if L==0 "Abans d'accedir a qualsevol altra opció" @@ -3251,36 +3281,6 @@ const char *Txt_Before_going_to_any_other_option_you_must_fill_your_nickname = " você deve preencher a seu alcunha."; #endif -const char *Txt_Before_going_to_any_other_option_you_must_fill_your_nickname_and_email_address = -#if L==0 - "Abans d'accedir a qualsevol altra opció" - " ha de omplir el seu sobrenom i la seva adreça de correu electrònic."; -#elif L==1 - "Bevor ich auf jede andere Option" - " müssen Sie Ihren Namen und E-Mail-Adresse ein."; -#elif L==2 - "Before going to any other option" - " you must fill your nickname and email address."; -#elif L==3 - "Antes de acceder a cualquier otra opción" - " debe rellenar su apodo y su dirección de correo electrónico."; -#elif L==4 - "Avant d'aller à une autre option" - " vous devez remplir votre surnom et votre adresse e-mail."; -#elif L==5 - "Antes de acceder a cualquier otra opción" - " debe rellenar su apodo y su dirección de correo electrónico."; // Okoteve traducción -#elif L==6 - "Prima di scegliere qualsiasi altra opzione" - " devi compilare il tuo soprannome e il tuo indirizzo e-mail."; -#elif L==7 - "Zanim przejdziemy do innych opcji" - " nalezy w tym nick i adresu e-mail."; -#elif L==8 - "Antes de ir para qualquer outra opção" - " você deve preencher a seu alcunha e endereço de e-mail."; -#endif - const char *Txt_Before_going_to_any_other_option_you_must_fill_your_institution = #if L==0 "Abans d'accedir a qualsevol altra opció" @@ -5671,27 +5671,6 @@ const char *Txt_Create_mail_domain = "Criar domínio de email"; #endif -const char *Txt_Create_new_user_account = -#if L==0 - "Crea nou compte d'usuari"; -#elif L==1 - "Neues Benutzerkonto anlegen"; -#elif L==2 - "Create new user account"; -#elif L==3 - "Crear nueva cuenta de usuario"; -#elif L==4 - "Créer nouveau compte d'utilisateur"; -#elif L==5 - "Crear nueva cuenta de usuario"; // Okoteve traducción -#elif L==6 - "Crea nuovo account utente"; -#elif L==7 - "Utwórz nowe konto użytkownika"; -#elif L==8 - "Criar uma nova conta de usuário"; -#endif - const char *Txt_Create_notice = #if L==0 "Crear avís"; @@ -24097,6 +24076,27 @@ const char *Txt_New_notice = "Novo aviso"; #endif +const char *Txt_New_on_PLATFORM_Sign_up = // Warning: it is very important to include %s in the following sentences +#if L==0 + "No té compte a %s? Registra't ara"; +#elif L==1 + "Neu bei %s? Registriere Dich!"; +#elif L==2 + "New on %s? Sign up"; +#elif L==3 + "¿No tiene cuenta en %s? Regístrese"; +#elif L==4 + "Nouveau sur %s? Inscrivez-vous"; +#elif L==5 + "¿No tiene cuenta en %s? Regístrese"; // Okoteve traducción +#elif L==6 + "Nuovo su %s? Iscriviti"; +#elif L==7 + "Pierwszy raz na %s? Zarejestruj się"; +#elif L==8 + "Novo no %s? Inscreva-se"; +#endif + const char *Txt_New_password = #if L==0 "Nova contrasenya"; @@ -49570,21 +49570,21 @@ const char *Txt_You_can_not_delete_this_ID = #if L==0 "No puede eliminar este ID (DNI/cédula)."; // Necessita traduccio #elif L==1 - "You can not delete this ID."; // Need Übersetzung + "You can not delete this ID."; // Need Übersetzung #elif L==2 "You can not delete this ID."; #elif L==3 "No puede eliminar este ID (DNI/cédula)."; #elif L==4 - "You can not delete this ID."; // Besoin de traduction + "You can not delete this ID."; // Besoin de traduction #elif L==5 "No puede eliminar este ID (DNI/cédula)."; // Okoteve traducción #elif L==6 "Non puoi cancellare questo ID."; #elif L==7 - "You can not delete this ID."; // Potrzebujesz tlumaczenie + "You can not delete this ID."; // Potrzebujesz tlumaczenie #elif L==8 - "You can not delete this ID."; // Necessita de tradução + "You can not delete this ID."; // Necessita de tradução #endif const char *Txt_You_can_not_disable_file_uploading_once_folders_have_been_created = diff --git a/swad_user.c b/swad_user.c index 94a0a506f..f574e4c24 100644 --- a/swad_user.c +++ b/swad_user.c @@ -164,11 +164,9 @@ static void Usr_SetUsrRoleAndPrefs (void); static Rol_Role_t Usr_GetMaxRole (unsigned Roles); static void Usr_ShowFormRequestNewAccountWithParams (const char *NewNicknameWithoutArroba, - const char *NewEmail, - const char *NewID); + const char *NewEmail); static bool Usr_GetParamsNewAccount (char *NewNicknameWithoutArroba, char *NewEmail, - char *NewID, char *NewEncryptedPassword); static void Usr_PutLinkToRemoveMyAccount (void); static void Usr_PrintAccountSeparator (void); @@ -1761,7 +1759,7 @@ void Usr_Logout (void) void Usr_WriteFormLogin (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; - extern const char *Txt_Create_new_user_account; + extern const char *Txt_New_on_PLATFORM_Sign_up; extern const char *Txt_Create_account; extern const char *Txt_Enter_from_X; extern const char *Txt_nick_email_or_ID; @@ -1770,10 +1768,11 @@ void Usr_WriteFormLogin (void) extern const char *Txt_I_forgot_my_password; /***** Link to create a new account *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); Act_FormStart (ActFrmUsrAcc); - Act_LinkFormSubmit (Txt_Create_new_user_account,The_ClassFormul[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("arroba",Txt_Create_account,Txt_Create_new_user_account); + sprintf (Gbl.Title,Txt_New_on_PLATFORM_Sign_up,Cfg_PLATFORM_SHORT_NAME); + Act_LinkFormSubmit (Gbl.Title,The_ClassFormul[Gbl.Prefs.Theme]); + Lay_PutSendIcon ("arroba",Txt_Create_account,Gbl.Title); fprintf (Gbl.F.Out,""); /***** Link to enter from external site *****/ @@ -2729,17 +2728,13 @@ static bool Usr_CreateNewAccountAndLogIn (void) { char NewNicknameWithoutArroba[Nck_MAX_BYTES_NICKNAME_WITH_ARROBA+1]; char NewEmail[Cns_MAX_BYTES_STRING+1]; - char NewID[ID_MAX_LENGTH_USR_ID+1]; char NewEncryptedPassword[Cry_LENGTH_ENCRYPTED_STR_SHA512_BASE64+1]; - if (Usr_GetParamsNewAccount (NewNicknameWithoutArroba,NewEmail,NewID,NewEncryptedPassword)) + if (Usr_GetParamsNewAccount (NewNicknameWithoutArroba,NewEmail,NewEncryptedPassword)) { - /***** Set user's ID to the ID typed by the user *****/ - ID_ReallocateListIDs (&Gbl.Usrs.Me.UsrDat,1); - strncpy (Gbl.Usrs.Me.UsrDat.IDs.List[0].ID,NewID,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); - Gbl.Usrs.Me.UsrDat.IDs.List[0].Confirmed = false; // User's ID will be stored as not confirmed + /***** User's has no ID *****/ + Gbl.Usrs.Me.UsrDat.IDs.Num = 0; + Gbl.Usrs.Me.UsrDat.IDs.List = NULL; /***** Set password to the password typed by the user *****/ strcpy (Gbl.Usrs.Me.UsrDat.Password,NewEncryptedPassword); @@ -2764,7 +2759,7 @@ static bool Usr_CreateNewAccountAndLogIn (void) else { /***** Show form again ******/ - Usr_ShowFormRequestNewAccountWithParams (NewNicknameWithoutArroba,NewEmail,NewID); + Usr_ShowFormRequestNewAccountWithParams (NewNicknameWithoutArroba,NewEmail); return false; } } @@ -3091,15 +3086,14 @@ void Usr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction) /*****************************************************************************/ static void Usr_ShowFormRequestNewAccountWithParams (const char *NewNicknameWithoutArroba, - const char *NewEmail, - const char *NewID) + const char *NewEmail) { extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Log_in; extern const char *Txt_Nickname; extern const char *Txt_Email; - extern const char *Txt_ID; - extern const char *Txt_Create_new_user_account; + // extern const char *Txt_ID; + extern const char *Txt_New_on_PLATFORM_Sign_up; extern const char *Txt_Create_account; /***** Link to log in *****/ @@ -3113,7 +3107,8 @@ static void Usr_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith /***** Form to enter the ID of the new user *****/ fprintf (Gbl.F.Out,"
"); Act_FormStart (ActCreUsrAcc); - Lay_StartRoundFrameTable10 (NULL,2,Txt_Create_new_user_account); + sprintf (Gbl.Title,Txt_New_on_PLATFORM_Sign_up,Cfg_PLATFORM_SHORT_NAME); + Lay_StartRoundFrameTable10 (NULL,2,Gbl.Title); /***** Nickname *****/ fprintf (Gbl.F.Out,"" @@ -3145,21 +3140,6 @@ static void Usr_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith Cns_MAX_BYTES_STRING, NewEmail); - /***** User's ID *****/ - fprintf (Gbl.F.Out,"" - "" - "%s: " - "" - "" - "" - "" - "", - The_ClassFormul[Gbl.Prefs.Theme], - Txt_ID, - ID_MAX_LENGTH_USR_ID, - NewID); - /***** Password *****/ Pwd_PutFormToGetNewPasswordTwice (); @@ -3182,21 +3162,19 @@ static void Usr_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith static bool Usr_GetParamsNewAccount (char *NewNicknameWithoutArroba, char *NewEmail, - char *NewID, char *NewEncryptedPassword) { extern const char *Txt_The_nickname_X_had_been_registered_by_another_user; extern const char *Txt_The_nickname_entered_X_is_not_valid_; extern const char *Txt_The_email_address_X_had_been_registered_by_another_user; extern const char *Txt_The_email_address_entered_X_is_not_valid; - extern const char *Txt_The_ID_X_is_not_valid; extern const char *Txt_You_have_not_written_twice_the_same_new_password; char Query[1024]; char NewNicknameWithArroba[Nck_MAX_BYTES_NICKNAME_WITH_ARROBA+1]; char NewPlainPassword[2][Pwd_MAX_LENGTH_PLAIN_PASSWORD+1]; bool Error = false; - /***** Step 1/4: Get new nickname from form *****/ + /***** Step 1/3: Get new nickname from form *****/ Par_GetParToText ("NewNick",NewNicknameWithArroba,Nck_MAX_BYTES_NICKNAME_WITH_ARROBA); if (Nck_CheckIfNickWithArrobaIsValid (NewNicknameWithArroba)) // If new nickname is valid @@ -3228,7 +3206,7 @@ static bool Usr_GetParamsNewAccount (char *NewNicknameWithoutArroba, Lay_ShowAlert (Lay_WARNING,Gbl.Message); } - /***** Step 2/4: Get new e-mail from form *****/ + /***** Step 2/3: Get new e-mail from form *****/ Par_GetParToText ("NewEmail",NewEmail,Cns_MAX_BYTES_STRING); if (Mai_CheckIfEmailIsValid (NewEmail)) // New e-mail is valid @@ -3253,20 +3231,7 @@ static bool Usr_GetParamsNewAccount (char *NewNicknameWithoutArroba, Lay_ShowAlert (Lay_WARNING,Gbl.Message); } - /***** Step 3/4: Get new user's ID from form *****/ - Par_GetParToText ("NewID",NewID,ID_MAX_LENGTH_USR_ID); - // Users' IDs are always stored internally in capitals and without leading zeros - Str_RemoveLeadingZeros (NewID); - Str_ConvertToUpperText (NewID); - - if (!ID_CheckIfUsrIDIsValid (NewID)) // New ID is not valid - { - Error = true; - sprintf (Gbl.Message,Txt_The_ID_X_is_not_valid,NewID); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); - } - - /***** Step 3/4: Get new user's ID from form *****/ + /***** Step 3/3: Get new user's ID from form *****/ Par_GetParToText ("Paswd1",NewPlainPassword[0],Pwd_MAX_LENGTH_PLAIN_PASSWORD); Par_GetParToText ("Paswd2",NewPlainPassword[1],Pwd_MAX_LENGTH_PLAIN_PASSWORD); if (strcmp (NewPlainPassword[0],NewPlainPassword[1])) @@ -3317,7 +3282,7 @@ void Usr_ShowFormAccount (void) if (Gbl.Usrs.Me.Logged) Usr_ShowFormChangeMyAccount (); else - Usr_ShowFormRequestNewAccountWithParams ("","",""); + Usr_ShowFormRequestNewAccountWithParams ("",""); } /*****************************************************************************/ @@ -3326,9 +3291,9 @@ void Usr_ShowFormAccount (void) void Usr_ShowFormChangeMyAccount (void) { - extern const char *Txt_Before_going_to_any_other_option_you_must_fill_your_nickname_and_email_address; extern const char *Txt_Before_going_to_any_other_option_you_must_fill_your_nickname; extern const char *Txt_Before_going_to_any_other_option_you_must_fill_your_email_address; + extern const char *Txt_Before_going_to_any_other_option_you_must_fill_your_ID; extern const char *Txt_User_account; /***** Get current user's nickname and e-mail address @@ -3338,14 +3303,11 @@ void Usr_ShowFormChangeMyAccount (void) /***** Check nickname and e-mail *****/ if (!Gbl.Usrs.Me.UsrDat.Nickname[0]) - { - if (!Gbl.Usrs.Me.UsrDat.Email[0]) - Lay_ShowAlert (Lay_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname_and_email_address); - else - Lay_ShowAlert (Lay_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname); - } + Lay_ShowAlert (Lay_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname); else if (!Gbl.Usrs.Me.UsrDat.Email[0]) Lay_ShowAlert (Lay_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_email_address); + else if (!Gbl.Usrs.Me.UsrDat.IDs.Num) + Lay_ShowAlert (Lay_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_ID); /***** Put links to change my password and to remove my account*****/ fprintf (Gbl.F.Out,"
");