summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/adduserdrake
blob: a2d3807665dfcc02313185a83d301e0118abdbf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl

use lib qw(/usr/lib/libDrakX);

use standalone;     #- warning, standalone must be loaded very first, for 'explanations'

use common;
use interactive;
use security::level;
use authentication;
use any;

my $users = []; 
my $in;

if (my @l = grep { ! /^-/ } @ARGV) {
    $users = [ map { { name => $_, realname => $_ } } @l ];
} else {
    $in = 'interactive'->vnew('su');
    any::ask_users($in, $users, security::level::get(), []);
}

any::add_users($users, authentication::get());

$in->exit(0) if $in;