diff options
Diffstat (limited to 'rhimport')
-rwxr-xr-x | rhimport | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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; |