summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-04 18:22:27 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-04 18:22:27 (GMT)
commitf48ce6d5bcbe25ed3d6b0e2aa118ac56cda07254 (patch)
tree65318b9f07acf1448de3657f170a4aece3761a05
parent53314380a21a394cf7f38420e65af5fc8dd3ed16 (diff)
rd-user bug fixes
-rwxr-xr-xlib/RHRD/rddb.pm2
-rwxr-xr-xutils/rd-user6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm
index 1e021ef..c535576 100755
--- a/lib/RHRD/rddb.pm
+++ b/lib/RHRD/rddb.pm
@@ -130,7 +130,7 @@ sub add_user
my $sth = $dbh->prepare($sql)
or return (undef, 'ERROR', "Database Error: " . $dbh->errstr);
- my $cnt = $sth->execute($username, $token, $fullname)
+ my $cnt = $sth->execute($username, $fullname, $token)
or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
$sth->finish();
diff --git a/utils/rd-user b/utils/rd-user
index c891985..5b9d479 100755
--- a/utils/rd-user
+++ b/utils/rd-user
@@ -31,7 +31,7 @@ if ($> != 0 ) {
}
my $num_args = $#ARGV + 1;
-if ($num_args != 2) {
+if ($num_args != 2 && $num_args !=3) {
print STDERR "Usage: rd-user (check|add|remove) <username> [ fullname ]\n";
exit 1;
}
@@ -65,6 +65,10 @@ if(defined $dbh) {
print int($href->{cnt}) . " " . $href->{name} . " deleted\n";
}
}
+ } else {
+ print STDERR "unknown command\n";
+ RHRD::rddb::closedb($dbh);
+ exit 1;
}
RHRD::rddb::closedb($dbh);