diff --git a/swad_HTML.c b/swad_HTML.c index ee2946e7..408753a6 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -929,6 +929,23 @@ void HTM_INPUT_IMAGE (const char *ImgFile,const char *Title,const char *Class) Title,Title,Class); } +void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder, + const char *AutoComplete,bool Required) + { + fprintf (Gbl.F.Out,""); + } + /*****************************************************************************/ /********************************* Text areas ********************************/ /*****************************************************************************/ diff --git a/swad_HTML.h b/swad_HTML.h index 3d9b6b54..53929d97 100644 --- a/swad_HTML.h +++ b/swad_HTML.h @@ -98,6 +98,8 @@ void HTM_INPUT_URL (const char *Name,const char *Value,bool SubmitOnChange, void HTM_INPUT_FILE (const char *Accept,bool SubmitOnChange); void HTM_INPUT_BUTTON (const char *Name,const char *Value,const char *Attr); void HTM_INPUT_IMAGE (const char *ImgFile,const char *Title,const char *Class); +void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder, + const char *AutoComplete,bool Required); void HTM_TEXTAREA_Begin (const char *fmt,...); void HTM_TEXTAREA_End (void); diff --git a/swad_changelog.h b/swad_changelog.h index 30fa3cd5..508638d0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.51.13 (2019-11-04)" +#define Log_PLATFORM_VERSION "SWAD 19.51.14 (2019-11-04)" #define CSS_FILE "swad19.47.css" #define JS_FILE "swad19.39.js" /* @@ -495,6 +495,7 @@ ps2pdf source.ps destination.pdf // TODO: Impedir la creación y edición de proyectos si no son editables. // TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia) + Version 19.51.14: Nov 04, 2019 Code refactoring in HTML inputs. (245868 lines) Version 19.51.13: Nov 04, 2019 Code refactoring in HTML inputs. (245874 lines) Version 19.51.12: Nov 04, 2019 Code refactoring in HTML inputs. (245873 lines) Version 19.51.11: Nov 04, 2019 Code refactoring in HTML inputs. (245868 lines) diff --git a/swad_password.c b/swad_password.c index cbc9e953..eb64b29f 100644 --- a/swad_password.c +++ b/swad_password.c @@ -691,11 +691,7 @@ void Pwd_ShowFormChgMyPwd (void) HTM_TD_End (); HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - fprintf (Gbl.F.Out,"", - Pwd_MAX_CHARS_PLAIN_PASSWORD); + HTM_INPUT_PASSWORD ("UsrPwd",NULL,"off",true); HTM_TD_End (); HTM_TR_End (); @@ -745,12 +741,7 @@ void Pwd_PutFormToGetNewPasswordOnce (void) /***** Input ****/ HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,""); + HTM_INPUT_PASSWORD ("Passwd",Txt_HELP_password,NULL,true); HTM_TD_End (); HTM_TR_End (); @@ -764,8 +755,8 @@ void Pwd_PutFormToGetNewPasswordTwice (void) { extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *Txt_New_password; - extern const char *Txt_HELP_password; extern const char *Txt_Retype_new_password; + extern const char *Txt_HELP_password; /***** 1st password *****/ /* Begin form element */ @@ -780,12 +771,7 @@ void Pwd_PutFormToGetNewPasswordTwice (void) /* Input */ HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - fprintf (Gbl.F.Out,""); + HTM_INPUT_PASSWORD ("Paswd1",Txt_HELP_password,NULL,true); HTM_TD_End (); HTM_TR_End (); @@ -803,12 +789,7 @@ void Pwd_PutFormToGetNewPasswordTwice (void) /* Input */ HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - fprintf (Gbl.F.Out,""); + HTM_INPUT_PASSWORD ("Paswd2",Txt_HELP_password,NULL,true); HTM_TD_End (); HTM_TR_End (); @@ -891,10 +872,7 @@ void Pwd_AskForConfirmationOnDangerousAction (void) /***** Password *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"%s: ",Txt_For_security_enter_your_password); - fprintf (Gbl.F.Out,"", - Pwd_MAX_CHARS_PLAIN_PASSWORD); + HTM_INPUT_PASSWORD ("OthUsrPwd",NULL,"off",true); HTM_LABEL_End (); HTM_DIV_End (); diff --git a/swad_text.c b/swad_text.c index bcf1bab5..0506d8a1 100644 --- a/swad_text.c +++ b/swad_text.c @@ -14372,25 +14372,25 @@ const char *Txt_HELP_nickname = "Exemplo: @silva"; #endif -const char *Txt_HELP_password = // Warning: it is very important to include %u in the following sentences +const char *Txt_HELP_password = #if L==1 // ca - "%u o més caràcters"; + "8 o més caràcters"; #elif L==2 // de - "%u oder mehr Zeichen"; + "8 oder mehr Zeichen"; #elif L==3 // en - "%u or more characters"; + "8 or more characters"; #elif L==4 // es - "%u o más caracteres"; + "8 o más caracteres"; #elif L==5 // fr - "%u ou plusieurs caractères"; + "8 ou plusieurs caractères"; #elif L==6 // gn - "%u o más caracteres"; // Okoteve traducción + "8 o más caracteres"; // Okoteve traducción #elif L==7 // it - "%u o più caratteri"; + "8 o più caratteri"; #elif L==8 // pl - "%u lub więcej znaków"; + "8 lub więcej znaków"; #elif L==9 // pt - "%u ou mais caracteres"; + "8 ou mais caracteres"; #endif const char *Txt_Hidden_MALE_PLURAL = diff --git a/swad_user.c b/swad_user.c index a54f44df..163c7c89 100644 --- a/swad_user.c +++ b/swad_user.c @@ -2621,10 +2621,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) (void)) HTM_LABEL_Begin ("for=\"UsrPwd\""); Ico_PutIcon ("key.svg",Txt_Password,"CONTEXT_ICO_16x16"); HTM_LABEL_End (); - fprintf (Gbl.F.Out,"", - Pwd_MAX_CHARS_PLAIN_PASSWORD, - Txt_password); + HTM_INPUT_PASSWORD ("UsrPwd",Txt_password,NULL,false); HTM_DIV_End (); /***** End table, send button and end box *****/