summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-04 17:52:56 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-04 17:52:56 (GMT)
commit8a54dd745f6bf2b5a0c38b5777f36621e3d40c3d (patch)
tree3d52ac9a74d8995ba88df88c241ebb0de83be946 /utils
parentd60ac079e1d725b042cdf1b49cbd3d75710679e0 (diff)
added support for full name for rd-user add
Diffstat (limited to 'utils')
-rwxr-xr-xutils/rd-user5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/rd-user b/utils/rd-user
index 019f004..c891985 100755
--- a/utils/rd-user
+++ b/utils/rd-user
@@ -32,12 +32,13 @@ if ($> != 0 ) {
my $num_args = $#ARGV + 1;
if ($num_args != 2) {
- print STDERR "Usage: rd-user (check|add|remove) <username>\n";
+ print STDERR "Usage: rd-user (check|add|remove) <username> [ fullname ]\n";
exit 1;
}
my $cmd = $ARGV[0];
my $username = $ARGV[1];
+my $fullname = $ARGV[2];
my ($dbh, undef, $errorstring) = RHRD::rddb::opendb();
if(defined $dbh) {
@@ -48,7 +49,7 @@ if(defined $dbh) {
exit $result;
} elsif($cmd eq "add") {
my $token = mkpasswd(-length => 16, -minnum => 3, -minupper => 3, -minspecial => 0);
- (my $cnt, undef, $errorstring) = RHRD::rddb::add_user($dbh, $username, $token);
+ (my $cnt, undef, $errorstring) = RHRD::rddb::add_user($dbh, $username, $token, $fullname);
unless(defined $cnt) {
print "$errorstring\n";
RHRD::rddb::closedb($dbh);