User is now prompted for their password twice at registration.
Turned echo off during such prompting... And 'tags' file is in .cvsignore (so I can run ctags *.[ch]) git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@21 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
8f8b2eadbf
commit
82acdecfa1
|
@ -1 +1,2 @@
|
||||||
dgamelaunch
|
dgamelaunch
|
||||||
|
tags
|
||||||
|
|
|
@ -284,9 +284,10 @@ changepw ()
|
||||||
char buf[21];
|
char buf[21];
|
||||||
int error = 2;
|
int error = 2;
|
||||||
|
|
||||||
if (!loggedin)
|
/* A precondiction is that struct `me' exists because we can be not-yet-logged-in. */
|
||||||
return;
|
if (!me)
|
||||||
|
exit(122); /* Die. */
|
||||||
|
|
||||||
while (error)
|
while (error)
|
||||||
{
|
{
|
||||||
char repeatbuf[21];
|
char repeatbuf[21];
|
||||||
|
@ -294,8 +295,7 @@ changepw ()
|
||||||
|
|
||||||
mvaddstr (1, 1, VER1);
|
mvaddstr (1, 1, VER1);
|
||||||
|
|
||||||
mvaddstr (5, 1,
|
mvprintw (5, 1, "Please enter a%s password. Remember that this is sent over the net", loggedin ? " new" : "");
|
||||||
"Please enter a new password. Remember that this is sent over the net");
|
|
||||||
mvaddstr (6, 1,
|
mvaddstr (6, 1,
|
||||||
"in plaintext, so make it something new and expect it to be relatively");
|
"in plaintext, so make it something new and expect it to be relatively");
|
||||||
mvaddstr (7, 1, "insecure.");
|
mvaddstr (7, 1, "insecure.");
|
||||||
|
@ -310,8 +310,11 @@ changepw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh ();
|
refresh ();
|
||||||
|
|
||||||
|
noecho();
|
||||||
getnstr (buf, 20);
|
getnstr (buf, 20);
|
||||||
|
echo(); /* Putting echo back on just for saftey and because it can't hurt. */
|
||||||
|
|
||||||
if (buf && *buf == '\0')
|
if (buf && *buf == '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -320,8 +323,10 @@ changepw ()
|
||||||
|
|
||||||
mvaddstr (12, 1, "And again:");
|
mvaddstr (12, 1, "And again:");
|
||||||
mvaddstr (13, 1, "=> ");
|
mvaddstr (13, 1, "=> ");
|
||||||
|
|
||||||
|
noecho();
|
||||||
getnstr (repeatbuf, 20);
|
getnstr (repeatbuf, 20);
|
||||||
|
echo(); /* Here is the important echo(); if the former is removed. */
|
||||||
|
|
||||||
if (!strcmp (buf, repeatbuf))
|
if (!strcmp (buf, repeatbuf))
|
||||||
error = 0;
|
error = 0;
|
||||||
|
@ -626,24 +631,8 @@ newuser ()
|
||||||
|
|
||||||
clear ();
|
clear ();
|
||||||
|
|
||||||
mvaddstr (1, 1, VER1);
|
changepw(); /* Calling changepw instead to prompt twice. */
|
||||||
|
|
||||||
mvaddstr (5, 1, "Please enter a password.");
|
|
||||||
mvaddstr (6, 1,
|
|
||||||
"This is only trivially encoded at the server. Please use something");
|
|
||||||
mvaddstr (7, 1, "new and expect it to be relatively insecure.");
|
|
||||||
mvaddstr (8, 1, "20 character max. No ':' characters.");
|
|
||||||
mvaddstr (10, 1, "=> ");
|
|
||||||
|
|
||||||
refresh ();
|
|
||||||
getnstr (buf, 20);
|
|
||||||
|
|
||||||
/* we warned em */
|
|
||||||
if (strstr (buf, ":") != NULL)
|
|
||||||
exit (112);
|
|
||||||
|
|
||||||
me->password = strdup (crypt (buf, buf));
|
|
||||||
|
|
||||||
/* email step */
|
/* email step */
|
||||||
|
|
||||||
clear ();
|
clear ();
|
||||||
|
|
Loading…
Reference in New Issue