summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/adduserdrake
blob: b449ef52b9a5478802a9a4c1652fe1afa59b1d72 (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_user($in, $users, security::level::get(), needauser => 1);
}

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

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