Commit 42fc3c98 authored by rswindell's avatar rswindell
Browse files

Use the new MIN_PASS_LEN macro rather than harding '4' in the code and

in the text.dat. This may be a sysop-configurable value in the future.
text.dat NewPasword is now NewPassswordPromptFmt and includes both the
minimum and maximum password length as % specifiers.
parent 235365ab
......@@ -242,7 +242,7 @@ bool sbbs_t::logon()
if(cfg.sys_misc&SM_PWEDIT && yesno(text[NewPasswordQ]))
while(online) {
bputs(text[NewPassword]);
bprintf(text[NewPasswordPromptFmt], MIN_PASS_LEN, LEN_PASS);
getstr(str,LEN_PASS,K_UPPER|K_LINE);
truncsp(str);
if(chkpass(str,&useron,true))
......
......@@ -378,7 +378,7 @@ BOOL sbbs_t::newuser()
if(cfg.sys_misc&SM_PWEDIT && text[NewPasswordQ][0] && yesno(text[NewPasswordQ]))
while(online) {
bputs(text[NewPassword]);
bprintf(text[NewPasswordPromptFmt], MIN_PASS_LEN, LEN_PASS);
getstr(str,LEN_PASS,K_UPPER|K_LINE);
truncsp(str);
if(chkpass(str,&useron,true)) {
......
......@@ -702,7 +702,7 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
SAFECOPY(pass,passwd);
strupr(pass);
if(strlen(pass)<4) {
if(strlen(pass) < MIN_PASS_LEN) {
bputs(text[PasswordTooShort]);
return(false);
}
......
......@@ -342,7 +342,7 @@ enum {
,HappyBirthday
,TimeToChangePw
,NewPasswordQ
,NewPassword
,NewPasswordPromptFmt
,VerifyPassword
,Wrong
,PasswordChanged
......
......@@ -534,8 +534,8 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x01\x77\x01\x68\x59\x6f\x75\x20\x68\x61\x76\x65\x6e\x27\x74\x20\x63\x68\x61\x6e\x67\x65\x64\x20\x79\x6f\x75\x72\x20\x70\x61\x73"
"\x73\x77\x6f\x72\x64\x20\x69\x6e\x20\x6d\x6f\x72\x65\x20\x74\x68\x61\x6e\x20\x25\x64\x20\x64\x61\x79\x73\x2e\x0d\x0a\x0d\x0a" // 330 TimeToChangePw
,"\x0d\x0a\x45\x6e\x74\x65\x72\x20\x61\x20\x64\x69\x66\x66\x65\x72\x65\x6e\x74\x20\x70\x61\x73\x73\x77\x6f\x72\x64" // 331 NewPasswordQ
,"\x01\x5f\x01\x3f\x01\x79\x01\x68\x4e\x65\x77\x20\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x28\x34\x2d\x38\x20\x63\x68\x61\x72\x73\x29"
"\x3a\x20" // 332 NewPassword
,"\x01\x5f\x01\x3f\x01\x79\x01\x68\x4e\x65\x77\x20\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x28\x25\x75\x2d\x25\x75\x20\x63\x68\x61\x72"
"\x73\x29\x3a\x20" // 332 NewPasswordPromptFmt
,"\x01\x5f\x01\x79\x01\x68\x56\x65\x72\x69\x66\x79\x20\x28\x65\x6e\x74\x65\x72\x20\x61\x67\x61\x69\x6e\x29\x3a\x20\x01\x6e" // 333 VerifyPassword
,"\x07\x01\x72\x01\x68\x57\x72\x6f\x6e\x67\x21" // 334 Wrong
,"\x01\x77\x01\x68\x50\x61\x73\x73\x77\x6f\x72\x64\x20\x63\x68\x61\x6e\x67\x65\x64\x2e\x0d\x0a" // 335 PasswordChanged
......@@ -628,10 +628,10 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x01\x6c\x01\x6e\x01\x63\x01\x68\x25\x73\x20\x01\x6e\x01\x63\x45\x78\x74\x65\x72\x6e\x61\x6c\x20\x50\x72\x6f\x67\x72\x61\x6d\x73"
"\x3a\x0d\x0a\x0d\x0a" // 380 XtrnProgLstHdr
,"\x01\x6e\x01\x63\x4e\x75\x6d\x20\x01\x68\xb3\x01\x6e\x01\x63\x20\x4e\x61\x6d\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" // 381 XtrnProgLstTitles
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" // 381 XtrnProgLstTitles
,"\x01\x68\xc4\xc4\xc4\xc4\xc5\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4"
"\xc4\x20\x20\x20\x20\x20\x20" // 382 XtrnProgLstUnderline
,"\x01\x68\x01\x63\x25\x33\x75\x20\xb3\x20\x01\x6e\x01\x63\x25\x2d\x32\x35\x2e\x32\x35\x73\x01\x68\x20\x20\x20\x20\x20\x20" // 383 XtrnProgLstFmt
"\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\x20" // 382 XtrnProgLstUnderline
,"\x01\x68\x01\x63\x25\x33\x75\x20\xb3\x20\x01\x6e\x01\x63\x25\x2d\x33\x32\x2e\x33\x32\x73\x01\x68\x20" // 383 XtrnProgLstFmt
,"\x0d\x0a\x01\x2d\x01\x63\x57\x68\x69\x63\x68\x20\x6f\x72\x20\x01\x68\x7e\x51\x01\x6e\x01\x63\x75\x69\x74\x3a\x20\x01\x68" // 384 WhichXtrnProg
,"\x0d\x0a\x25\x73\x20\x69\x73\x20\x63\x75\x72\x72\x65\x6e\x74\x6c\x79\x20\x72\x75\x6e\x6e\x69\x6e\x67\x20\x25\x73\x20\x6f\x6e\x20"
"\x6e\x6f\x64\x65\x20\x25\x64\x2e\x0d\x0a\x0d\x0a\x54\x72\x79\x20\x61\x67\x61\x69\x6e\x20\x6c\x61\x74\x65\x72\x2e\x0d\x0a\x0d\x0a"
......
......@@ -1081,7 +1081,7 @@ void sbbs_t::maindflts(user_t* user)
pause();
break;
}
bputs(text[NewPassword]);
bprintf(text[NewPasswordPromptFmt], MIN_PASS_LEN, LEN_PASS);
if(!getstr(str,LEN_PASS,K_UPPER|K_LINE))
break;
truncsp(str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment