Fix several problems:
1. Bus mouse selection didn't show up properly in mouse menu. 2. U&G management screen didn't respect cancel properly. 3. Novice not prompted to add users or set root password during installation. 4. Username length changes screw up user management form.
This commit is contained in:
parent
b8a83a83ca
commit
9b1696b002
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21701
@ -384,6 +384,15 @@ configNTP(dialogMenuItem *self)
|
|||||||
return status | DITEM_RESTORE;
|
return status | DITEM_RESTORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
configUsers(dialogMenuItem *self)
|
||||||
|
{
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
dmenuOpenSimple(&MenuUsermgmt, FALSE);
|
||||||
|
dialog_clear();
|
||||||
|
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
configXFree86(dialogMenuItem *self)
|
configXFree86(dialogMenuItem *self)
|
||||||
{
|
{
|
||||||
|
@ -600,6 +600,22 @@ installNovice(dialogMenuItem *self)
|
|||||||
"to browse the collection now?"))
|
"to browse the collection now?"))
|
||||||
configPackages(self);
|
configPackages(self);
|
||||||
|
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
if (!msgYesNo("Would you like to add any initial user accounts to the system?\n"
|
||||||
|
"Adding at least one account for yourself at this stage is suggested\n"
|
||||||
|
"since working as the \"root\" user is dangerous (it is easy to do\n"
|
||||||
|
"things which adversely affect the entire system)."))
|
||||||
|
configUsers(self);
|
||||||
|
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
if (!msgYesNo("Would you like to set the system manager's password now?\n\n"
|
||||||
|
"This is the password you'll use to log in as \"root\".")) {
|
||||||
|
WINDOW *w = savescr();
|
||||||
|
|
||||||
|
systemExecute("passwd root");
|
||||||
|
restorescr(w);
|
||||||
|
}
|
||||||
|
|
||||||
/* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */
|
/* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */
|
||||||
|
|
||||||
/* Give user the option of one last configuration spree */
|
/* Give user the option of one last configuration spree */
|
||||||
|
@ -343,7 +343,7 @@ whichMouse(dialogMenuItem *self)
|
|||||||
if (!strcmp(self->prompt, "COM4"))
|
if (!strcmp(self->prompt, "COM4"))
|
||||||
return !strcmp(buf, "/dev/cuaa3");
|
return !strcmp(buf, "/dev/cuaa3");
|
||||||
if (!strcmp(self->prompt, "BusMouse"))
|
if (!strcmp(self->prompt, "BusMouse"))
|
||||||
return !strcmp(buf, "/dev/msg0");
|
return !strcmp(buf, "/dev/mse0");
|
||||||
if (!strcmp(self->prompt, "PS/2"))
|
if (!strcmp(self->prompt, "PS/2"))
|
||||||
return !strcmp(buf, "/dev/psm0");
|
return !strcmp(buf, "/dev/psm0");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -396,6 +396,7 @@ extern int configPackages(dialogMenuItem *self);
|
|||||||
extern int configSaver(dialogMenuItem *self);
|
extern int configSaver(dialogMenuItem *self);
|
||||||
extern int configSaverTimeout(dialogMenuItem *self);
|
extern int configSaverTimeout(dialogMenuItem *self);
|
||||||
extern int configNTP(dialogMenuItem *self);
|
extern int configNTP(dialogMenuItem *self);
|
||||||
|
extern int configUsers(dialogMenuItem *self);
|
||||||
extern int configXFree86(dialogMenuItem *self);
|
extern int configXFree86(dialogMenuItem *self);
|
||||||
extern int configRouter(dialogMenuItem *self);
|
extern int configRouter(dialogMenuItem *self);
|
||||||
extern int configSamba(dialogMenuItem *self);
|
extern int configSamba(dialogMenuItem *self);
|
||||||
|
@ -108,7 +108,7 @@ static Layout groupLayout[] = {
|
|||||||
/* The user configuration menu. */
|
/* The user configuration menu. */
|
||||||
static Layout userLayout[] = {
|
static Layout userLayout[] = {
|
||||||
#define LAYOUT_UNAME 0
|
#define LAYOUT_UNAME 0
|
||||||
{ 3, 6, UT_NAMESIZE + 4, UT_NAMESIZE,
|
{ 3, 6, UT_NAMESIZE, UT_NAMESIZE + 1,
|
||||||
"Login ID:", "The login name of the new user (mandatory)",
|
"Login ID:", "The login name of the new user (mandatory)",
|
||||||
uname, STRINGOBJ, NULL },
|
uname, STRINGOBJ, NULL },
|
||||||
#define LAYOUT_UID 1
|
#define LAYOUT_UID 1
|
||||||
@ -356,7 +356,7 @@ userAddGroup(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Draw a group entry box */
|
/* Draw a group entry box */
|
||||||
draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 6,
|
draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 8,
|
||||||
USER_DIALOG_WIDTH - 17, dialog_attr, border_attr);
|
USER_DIALOG_WIDTH - 17, dialog_attr, border_attr);
|
||||||
wattrset(ds_win, dialog_attr);
|
wattrset(ds_win, dialog_attr);
|
||||||
mvwaddstr(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 22, " Add a new group ");
|
mvwaddstr(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 22, " Add a new group ");
|
||||||
@ -379,7 +379,7 @@ userAddGroup(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifyGroupSettings())
|
if (!cancel && !verifyGroupSettings())
|
||||||
goto reenter;
|
goto reenter;
|
||||||
|
|
||||||
/* Clear this crap off the screen */
|
/* Clear this crap off the screen */
|
||||||
@ -678,7 +678,7 @@ userAddUser(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Draw a user entry box */
|
/* Draw a user entry box */
|
||||||
draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 5,
|
draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 6,
|
||||||
USER_DIALOG_WIDTH - 6, dialog_attr, border_attr);
|
USER_DIALOG_WIDTH - 6, dialog_attr, border_attr);
|
||||||
wattrset(ds_win, dialog_attr);
|
wattrset(ds_win, dialog_attr);
|
||||||
mvwaddstr(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 22, " Add a new user ");
|
mvwaddstr(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 22, " Add a new user ");
|
||||||
@ -711,7 +711,7 @@ userAddUser(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifyUserSettings(ds_win))
|
if (!cancel && !verifyUserSettings(ds_win))
|
||||||
goto reenter;
|
goto reenter;
|
||||||
|
|
||||||
/* Clear this crap off the screen */
|
/* Clear this crap off the screen */
|
||||||
|
@ -384,6 +384,15 @@ configNTP(dialogMenuItem *self)
|
|||||||
return status | DITEM_RESTORE;
|
return status | DITEM_RESTORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
configUsers(dialogMenuItem *self)
|
||||||
|
{
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
dmenuOpenSimple(&MenuUsermgmt, FALSE);
|
||||||
|
dialog_clear();
|
||||||
|
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
configXFree86(dialogMenuItem *self)
|
configXFree86(dialogMenuItem *self)
|
||||||
{
|
{
|
||||||
|
@ -600,6 +600,22 @@ installNovice(dialogMenuItem *self)
|
|||||||
"to browse the collection now?"))
|
"to browse the collection now?"))
|
||||||
configPackages(self);
|
configPackages(self);
|
||||||
|
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
if (!msgYesNo("Would you like to add any initial user accounts to the system?\n"
|
||||||
|
"Adding at least one account for yourself at this stage is suggested\n"
|
||||||
|
"since working as the \"root\" user is dangerous (it is easy to do\n"
|
||||||
|
"things which adversely affect the entire system)."))
|
||||||
|
configUsers(self);
|
||||||
|
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
if (!msgYesNo("Would you like to set the system manager's password now?\n\n"
|
||||||
|
"This is the password you'll use to log in as \"root\".")) {
|
||||||
|
WINDOW *w = savescr();
|
||||||
|
|
||||||
|
systemExecute("passwd root");
|
||||||
|
restorescr(w);
|
||||||
|
}
|
||||||
|
|
||||||
/* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */
|
/* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */
|
||||||
|
|
||||||
/* Give user the option of one last configuration spree */
|
/* Give user the option of one last configuration spree */
|
||||||
|
@ -343,7 +343,7 @@ whichMouse(dialogMenuItem *self)
|
|||||||
if (!strcmp(self->prompt, "COM4"))
|
if (!strcmp(self->prompt, "COM4"))
|
||||||
return !strcmp(buf, "/dev/cuaa3");
|
return !strcmp(buf, "/dev/cuaa3");
|
||||||
if (!strcmp(self->prompt, "BusMouse"))
|
if (!strcmp(self->prompt, "BusMouse"))
|
||||||
return !strcmp(buf, "/dev/msg0");
|
return !strcmp(buf, "/dev/mse0");
|
||||||
if (!strcmp(self->prompt, "PS/2"))
|
if (!strcmp(self->prompt, "PS/2"))
|
||||||
return !strcmp(buf, "/dev/psm0");
|
return !strcmp(buf, "/dev/psm0");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -396,6 +396,7 @@ extern int configPackages(dialogMenuItem *self);
|
|||||||
extern int configSaver(dialogMenuItem *self);
|
extern int configSaver(dialogMenuItem *self);
|
||||||
extern int configSaverTimeout(dialogMenuItem *self);
|
extern int configSaverTimeout(dialogMenuItem *self);
|
||||||
extern int configNTP(dialogMenuItem *self);
|
extern int configNTP(dialogMenuItem *self);
|
||||||
|
extern int configUsers(dialogMenuItem *self);
|
||||||
extern int configXFree86(dialogMenuItem *self);
|
extern int configXFree86(dialogMenuItem *self);
|
||||||
extern int configRouter(dialogMenuItem *self);
|
extern int configRouter(dialogMenuItem *self);
|
||||||
extern int configSamba(dialogMenuItem *self);
|
extern int configSamba(dialogMenuItem *self);
|
||||||
|
@ -384,6 +384,15 @@ configNTP(dialogMenuItem *self)
|
|||||||
return status | DITEM_RESTORE;
|
return status | DITEM_RESTORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
configUsers(dialogMenuItem *self)
|
||||||
|
{
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
dmenuOpenSimple(&MenuUsermgmt, FALSE);
|
||||||
|
dialog_clear();
|
||||||
|
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
configXFree86(dialogMenuItem *self)
|
configXFree86(dialogMenuItem *self)
|
||||||
{
|
{
|
||||||
|
@ -600,6 +600,22 @@ installNovice(dialogMenuItem *self)
|
|||||||
"to browse the collection now?"))
|
"to browse the collection now?"))
|
||||||
configPackages(self);
|
configPackages(self);
|
||||||
|
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
if (!msgYesNo("Would you like to add any initial user accounts to the system?\n"
|
||||||
|
"Adding at least one account for yourself at this stage is suggested\n"
|
||||||
|
"since working as the \"root\" user is dangerous (it is easy to do\n"
|
||||||
|
"things which adversely affect the entire system)."))
|
||||||
|
configUsers(self);
|
||||||
|
|
||||||
|
dialog_clear_norefresh();
|
||||||
|
if (!msgYesNo("Would you like to set the system manager's password now?\n\n"
|
||||||
|
"This is the password you'll use to log in as \"root\".")) {
|
||||||
|
WINDOW *w = savescr();
|
||||||
|
|
||||||
|
systemExecute("passwd root");
|
||||||
|
restorescr(w);
|
||||||
|
}
|
||||||
|
|
||||||
/* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */
|
/* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */
|
||||||
|
|
||||||
/* Give user the option of one last configuration spree */
|
/* Give user the option of one last configuration spree */
|
||||||
|
@ -343,7 +343,7 @@ whichMouse(dialogMenuItem *self)
|
|||||||
if (!strcmp(self->prompt, "COM4"))
|
if (!strcmp(self->prompt, "COM4"))
|
||||||
return !strcmp(buf, "/dev/cuaa3");
|
return !strcmp(buf, "/dev/cuaa3");
|
||||||
if (!strcmp(self->prompt, "BusMouse"))
|
if (!strcmp(self->prompt, "BusMouse"))
|
||||||
return !strcmp(buf, "/dev/msg0");
|
return !strcmp(buf, "/dev/mse0");
|
||||||
if (!strcmp(self->prompt, "PS/2"))
|
if (!strcmp(self->prompt, "PS/2"))
|
||||||
return !strcmp(buf, "/dev/psm0");
|
return !strcmp(buf, "/dev/psm0");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -396,6 +396,7 @@ extern int configPackages(dialogMenuItem *self);
|
|||||||
extern int configSaver(dialogMenuItem *self);
|
extern int configSaver(dialogMenuItem *self);
|
||||||
extern int configSaverTimeout(dialogMenuItem *self);
|
extern int configSaverTimeout(dialogMenuItem *self);
|
||||||
extern int configNTP(dialogMenuItem *self);
|
extern int configNTP(dialogMenuItem *self);
|
||||||
|
extern int configUsers(dialogMenuItem *self);
|
||||||
extern int configXFree86(dialogMenuItem *self);
|
extern int configXFree86(dialogMenuItem *self);
|
||||||
extern int configRouter(dialogMenuItem *self);
|
extern int configRouter(dialogMenuItem *self);
|
||||||
extern int configSamba(dialogMenuItem *self);
|
extern int configSamba(dialogMenuItem *self);
|
||||||
|
@ -108,7 +108,7 @@ static Layout groupLayout[] = {
|
|||||||
/* The user configuration menu. */
|
/* The user configuration menu. */
|
||||||
static Layout userLayout[] = {
|
static Layout userLayout[] = {
|
||||||
#define LAYOUT_UNAME 0
|
#define LAYOUT_UNAME 0
|
||||||
{ 3, 6, UT_NAMESIZE + 4, UT_NAMESIZE,
|
{ 3, 6, UT_NAMESIZE, UT_NAMESIZE + 1,
|
||||||
"Login ID:", "The login name of the new user (mandatory)",
|
"Login ID:", "The login name of the new user (mandatory)",
|
||||||
uname, STRINGOBJ, NULL },
|
uname, STRINGOBJ, NULL },
|
||||||
#define LAYOUT_UID 1
|
#define LAYOUT_UID 1
|
||||||
@ -356,7 +356,7 @@ userAddGroup(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Draw a group entry box */
|
/* Draw a group entry box */
|
||||||
draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 6,
|
draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 8,
|
||||||
USER_DIALOG_WIDTH - 17, dialog_attr, border_attr);
|
USER_DIALOG_WIDTH - 17, dialog_attr, border_attr);
|
||||||
wattrset(ds_win, dialog_attr);
|
wattrset(ds_win, dialog_attr);
|
||||||
mvwaddstr(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 22, " Add a new group ");
|
mvwaddstr(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 22, " Add a new group ");
|
||||||
@ -379,7 +379,7 @@ userAddGroup(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifyGroupSettings())
|
if (!cancel && !verifyGroupSettings())
|
||||||
goto reenter;
|
goto reenter;
|
||||||
|
|
||||||
/* Clear this crap off the screen */
|
/* Clear this crap off the screen */
|
||||||
@ -678,7 +678,7 @@ userAddUser(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Draw a user entry box */
|
/* Draw a user entry box */
|
||||||
draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 5,
|
draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 6,
|
||||||
USER_DIALOG_WIDTH - 6, dialog_attr, border_attr);
|
USER_DIALOG_WIDTH - 6, dialog_attr, border_attr);
|
||||||
wattrset(ds_win, dialog_attr);
|
wattrset(ds_win, dialog_attr);
|
||||||
mvwaddstr(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 22, " Add a new user ");
|
mvwaddstr(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 22, " Add a new user ");
|
||||||
@ -711,7 +711,7 @@ userAddUser(dialogMenuItem *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifyUserSettings(ds_win))
|
if (!cancel && !verifyUserSettings(ds_win))
|
||||||
goto reenter;
|
goto reenter;
|
||||||
|
|
||||||
/* Clear this crap off the screen */
|
/* Clear this crap off the screen */
|
||||||
|
Loading…
Reference in New Issue
Block a user