summaryrefslogtreecommitdiffstats
path: root/perl-install/install/steps_interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install/steps_interactive.pm')
-rw-r--r--perl-install/install/steps_interactive.pm45
1 files changed, 18 insertions, 27 deletions
diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm
index e40f19eb0..0d3146df9 100644
--- a/perl-install/install/steps_interactive.pm
+++ b/perl-install/install/steps_interactive.pm
@@ -784,6 +784,16 @@ sub summary {
push @l, {
group => N("System"),
+ label => N("User management"),
+ clicked => sub {
+ if (my $u = any::ask_user($o, $o->{users}, $o->{security}, needauser => 1)) {
+ any::add_users([$u], $o->{authentication});
+ }
+ },
+ };
+
+ push @l, {
+ group => N("System"),
label => N("Services"),
val => sub {
require services;
@@ -935,37 +945,18 @@ sub summary {
}
#------------------------------------------------------------------------------
-sub setRootPassword {
- my ($o, $clicked) = @_;
- my $sup = $o->{superuser} ||= {};
- $sup->{password2} ||= $sup->{password} ||= "";
-
- if ($o->{security} >= 1 || $clicked) {
- require authentication;
- authentication::ask_root_password_and_authentication($o, $o->{net}, $sup, $o->{authentication} ||= {}, $o->{meta_class}, $o->{security});
- }
- install::steps::setRootPassword($o);
-}
-
-#------------------------------------------------------------------------------
-#-addUser
+#-setRootPassword_addUser
#------------------------------------------------------------------------------
-sub addUser {
- my ($o, $clicked) = @_;
+sub setRootPassword_addUser {
+ my ($o) = @_;
$o->{users} ||= [];
- if ($o->{security} < 1) {
- push @{$o->{users}}, { password => 'mandrake', realname => 'default', icon => 'automagic' }
- if !member('mandrake', map { $_->{name} } @{$o->{users}});
- }
- if ($o->{security} >= 1 || $clicked) {
- my @suggested_names = @{$o->{users}} ? () : grep { !/^\./ && $_ ne 'lost+found' && -d "$::prefix/home/$_" } all("$::prefix/home");
- any::ask_users($o, $o->{users}, $o->{security}, \@suggested_names);
- }
- add2hash($o, any::get_autologin());
- any::autologin($o, $o);
- any::set_autologin($o->do_pkgs, $o->{autologin}, $o->{desktop}) if $::globetrotter;
+ my $sup = $o->{superuser} ||= {};
+ $sup->{password2} ||= $sup->{password} ||= "";
+
+ any::ask_user_and_root($o, $sup, $o->{users}, $o->{security});
+ install::steps::setRootPassword($o);
install::steps::addUser($o);
}