diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-09-30 23:05:11 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-09-30 23:05:11 (GMT) |
commit | 6f1943313a0e503189dd9685483a9ecd1bd7cc6e (patch) | |
tree | 7461bd743125feb61a7f977a06e7698bb184d333 /utils/rhrd-ws-login | |
parent | 88ba274e7841fedffe9ef98b0933c0610ac6997c (diff) |
introduced rhrd context
Diffstat (limited to 'utils/rhrd-ws-login')
-rwxr-xr-x | utils/rhrd-ws-login | 8 |
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: $?"; } |