Allow user to login on the spot.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@195 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Joshua Kwan 2004-01-31 03:04:58 +00:00
parent 95d5ec6655
commit 710df809e0
3 changed files with 14 additions and 8 deletions

View File

@ -482,8 +482,7 @@ inprogressmenu ()
clear ();
drawbanner (1, 1);
mvprintw (3, 1,
"During playback, hit 'q' to return here%s.",
loggedin ? ", 'm' to contact the player" : "");
"During playback, hit 'q' to return here, 'm' to send mail (requires login");
mvaddstr (4, 1,
"(Use capital letter of selection to strip DEC graphics, VERY experimental!)");
mvaddstr (5, 1, "The following games are in progress:");
@ -789,7 +788,7 @@ initcurses ()
/* ************************************************************* */
void
loginprompt ()
loginprompt (int from_ttyplay)
{
char user_buf[22], pw_buf[22];
int error = 2, me_index = -1;
@ -802,8 +801,11 @@ loginprompt ()
drawbanner (1, 1);
if (from_ttyplay == 1)
mvaddstr (4, 1, "This operation requires you to be logged in.");
mvaddstr (5, 1,
"Please enter your username. (blank entry returns to main menu)");
"Please enter your username. (blank entry aborts)");
mvaddstr (7, 1, "=> ");
if (error == 1)
@ -1173,7 +1175,7 @@ editoptions ()
if (!rcfile) /* should not really happen except for old users */
write_canned_rcfile (rcfilename);
/* use ee to edit */
/* use whatever editor_main to edit */
myargv[0] = "";
myargv[1] = rcfilename;
@ -1196,7 +1198,6 @@ editoptions ()
else
waitpid(editor, NULL, 0);
refresh ();
}
@ -1448,7 +1449,7 @@ menuloop (void)
break;
case 'l':
if (!loggedin) /* not visible to loggedin */
loginprompt ();
loginprompt (0);
break;
}
}

View File

@ -75,7 +75,7 @@ extern void domailuser(char *username);
extern void drawmenu(void);
extern void freefile(void);
extern void initcurses(void);
extern void loginprompt(void);
extern void loginprompt(int from_ttyplay);
extern void newuser(void);
extern int passwordgood(char *cpw);
extern int readfile(int nolock);

View File

@ -194,6 +194,11 @@ ttypread (FILE * fp, Header * h, char **buf, int pread)
return READ_EOF;
break;
case 'm':
if (!loggedin)
{
initcurses();
loginprompt(1);
}
if (loggedin)
{
initcurses ();