summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/adduserdrake8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake
index 87384e06b..7ead7679b 100755
--- a/perl-install/standalone/adduserdrake
+++ b/perl-install/standalone/adduserdrake
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-use lib qw(/usr/lib/libDrakX);
+use lib qw(.); #/usr/lib/libDrakX);
use common qw(:common :functional :system :file);
use interactive;
@@ -28,8 +28,10 @@ if (my @l = grep { ! /^-/ } @ARGV) {
}
my $in = vnew interactive('su');
+my @users;
new:
+$u = { icon => translate('default') };
if ($in->ask_from_entries_refH(
[ _("Add user"), _("Accept user"), _("Done") ],
_("Enter a user\n%s", $users ? _("(already added %s)", join(", ", map { $_->{realname} || $_->{name} } @users)) : ''),
@@ -41,6 +43,8 @@ if ($in->ask_from_entries_refH(
_("Password (again)") => {val => \$u->{password2}, hidden => 1},
), $::beginner ? () : (
_("Shell") => {val => \$u->{shell}, list => \@shells, not_edit => !$::expert}
+ ), $security > 3 ? () : (
+ _("Icon") => {val => \$u->{icon}, list => [ map { translate($_) } @any::users ], not_edit => 1 },
),
],
focus_out => sub {
@@ -54,11 +58,11 @@ if ($in->ask_from_entries_refH(
$u->{name} or $o->ask_warn('', _("Please give a user name")), return (1,0);
$u->{name} =~ /^[a-z0-9_-]+$/ or $o->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0);
member($u->{name}, map { $_->{name} } @users) and $o->ask_warn('', _("This user name is already added")), return (1,0);
+ $u->{icon} = untranslate($u->{icon}, @any::users);
return 0;
},
)) {
push @users, $u;
- $u = {};
goto new;
}