Skip to content
Snippets Groups Projects
Commit fd8e6d52 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Display more of the user's password

Reversed the order of the pwmod date and the password itself.
The number of chars of the user's password displayed depends on the
terminal width. e.g. on an 80 column terminal, 18 chars will be
displayed. If the user's password is longer than what can be displayed,
this is indicated with a trailing "..". Wider displays (e.g. 132 column)
can display all 40 chars of a user's password.

This fixes issue #442

When passwords aren't displayed (due to sysop configuration), show
"<hidden>" instead of "XXXXXXXX" to make that more clear.
parent bf12f956
No related branches found
No related tags found
No related merge requests found
......@@ -80,10 +80,16 @@ void sbbs_t::useredit(int usernumber)
user.freecdt=cfg.level_freecdtperday[user.level];
putuserdat(&cfg,&user); /* Leave alone */
}
char user_pass[LEN_PASS + 1];
SAFECOPY(user_pass, user.pass);
size_t max_len = cols < 60 ? 8 : cols - 60;
if(strlen(user_pass) > max_len - 2)
SAFEPRINTF2(user_pass, "%.*s..", (int)(max_len - 2), user.pass);
bprintf(text[UeditAliasPassword]
,user.alias, (user.level>useron.level && console&CON_R_ECHO)
|| !(cfg.sys_misc&SM_ECHO_PW) ? "XXXXXXXX" : user.pass
, unixtodstr(&cfg,user.pwmod,tmp));
,user.alias
,unixtodstr(&cfg,user.pwmod,tmp)
,(user.level>useron.level || !(cfg.sys_misc&SM_ECHO_PW)) ? "<hidden>" : user_pass
);
bprintf(text[UeditRealNamePhone]
,user.level>useron.level && console&CON_R_ECHO
? "XXXXXXXX" : user.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment