summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-07-24 19:01:55 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-07-24 19:01:55 (GMT)
commit6761a44cfb25af3f923a53375f05e75e8570403d (patch)
tree5bb59562bae08a0edf8ea71c62d89f635b6213a7 /rhimport
parentd9df4264e66e6091538ab24c41fad20131526460 (diff)
switch to use systemwide RHRD perl module
Diffstat (limited to 'rhimport')
-rwxr-xr-xrhimport19
1 files changed, 10 insertions, 9 deletions
diff --git a/rhimport b/rhimport
index ba40b9a..f0be9df 100755
--- a/rhimport
+++ b/rhimport
@@ -23,6 +23,7 @@
use strict;
use Getopt::Long;
+use RHRD::rddb;
use lib '/usr/local/share/rhimport/';
use rhimport;
@@ -55,14 +56,14 @@ my $user = `/usr/bin/id -un`;
$user =~ s/\n//;
$user = 'heslinki';
-my ($dbh, $errorstring) = rhimport::opendb();
+my ($dbh, undef, $errorstring) = RHRD::rddb::opendb();
if(!defined $dbh) {
print "$errorstring\n";
exit 1;
}
-(my @allowed_dbs, $errorstring) = rhimport::get_dropboxes($dbh, $user);
-unless(defined $allowed_dbs[0]) {
- print "$allowed_dbs[1]\n";
+my @allowed_dbs = RHRD::rddb::get_dropboxes($dbh, $user);
+if(!defined $allowed_dbs[0] && defined $allowed_dbs[2]) {
+ print "$allowed_dbs[2]\n";
exit 1;
}
@@ -71,15 +72,15 @@ if($LISTALLOWED) {
print "+-------+-------------------------------------------------------------------\n";
for my $href ( @allowed_dbs ) {
if($href->{'TYPE'} eq 'show') {
- my @show_carts = rhimport::get_show_carts($dbh, $href->{'SHOWLOG'}, $href->{'GROUPLOWCART'}, $href->{'GROUPHIGHCART'});
- unless(defined $show_carts[0]) {
- print "$show_carts[1]\n";
+ my @show_carts = RHRD::rddb::get_show_carts($dbh, $href->{'SHOWLOG'}, $href->{'GROUPLOWCART'}, $href->{'GROUPHIGHCART'});
+ if(!defined $show_carts[0] && defined $show_carts[2]) {
+ print "$show_carts[2]\n";
exit 1;
}
print "| $href->{'SHOWID'} | $href->{'SHOWTITLE'}, Carts: [" . join(', ', @show_carts) . "]\n";
}
}
- rhimport::closedb($dbh);
+ RHRD::rddb::closedb($dbh);
exit 0;
}
@@ -116,7 +117,7 @@ my $import_log;
($ret, $import_log) = rhimport::import_single($FILE, $DROPBOX, $user, 0, $cl_error_cb);
$log .= $import_log;
-rhimport::closedb($dbh);
+RHRD::rddb::closedb($dbh);
if(!$ret) {
exit 1;