summaryrefslogtreecommitdiff
path: root/utils/rhrd-ws-login
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rhrd-ws-login')
-rwxr-xr-xutils/rhrd-ws-login8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/rhrd-ws-login b/utils/rhrd-ws-login
index a3cee53..79eeac5 100755
--- a/utils/rhrd-ws-login
+++ b/utils/rhrd-ws-login
@@ -38,14 +38,14 @@ my $username = $ENV{'USER'};
my $ret = 0;
-my ($dbh, undef, $errorstring) = RHRD::rddb::opendb();
-if(defined $dbh) {
+my ($ctx, undef, $errorstring) = RHRD::rddb::init();
+if(defined $ctx) {
my $macro = '';
if($cmd eq "logout") {
$macro = "LO!";
}
elsif($cmd eq "login") {
- (my $token, undef, $errorstring) = RHRD::rddb::get_token($dbh, $username);
+ (my $token, undef, $errorstring) = RHRD::rddb::get_token($ctx, $username);
if($token) {
$token =~ s/([ !'"\\])/\\$1/g;
$macro = "LO $username $token!";
@@ -58,7 +58,7 @@ if(defined $dbh) {
print_usage();
$ret = 1;
}
- RHRD::rddb::closedb($dbh);
+ RHRD::rddb::destroy($ctx);
unless ($macro eq '') {
system('/usr/bin/rmlsend', $macro) == 0 or die "system(/usr/bin/rmlsend, $macro) failed: $?";
}