diff options
Diffstat (limited to 'rhimport.pl')
-rwxr-xr-x | rhimport.pl | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/rhimport.pl b/rhimport.pl index 8f8a4ed..5c3b2ca 100755 --- a/rhimport.pl +++ b/rhimport.pl @@ -40,37 +40,42 @@ EOF my $user = 'martinland';#$ENV{'USER'}; $user or die "Username not found in environment"; -my $dbh = DBI->connect( "DBI:mysql:$DB:$DBHOST","$DBUSER","$DBPW") or die "Database Error: $DBI::errstr"; +# my $dbh = DBI->connect( "DBI:mysql:$DB:$DBHOST","$DBUSER","$DBPW") or die "Database Error: $DBI::errstr"; -my $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH from USER_PERMS, DROPBOXES where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME;}; +# my $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH from USER_PERMS, DROPBOXES where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME;}; -my $sth = $dbh->prepare($sql); -$sth->execute(); +# my $sth = $dbh->prepare($sql); +# $sth->execute(); my @allowed_dbs; -while(my ($group, $path) = $sth->fetchrow_array()) { - $path =~ s/\/\*$//; - my $perm = {}; - $perm->{'GROUP'} = $group; - $perm->{'PATH'} = $path; - push @allowed_dbs, $perm; -} -$sth->finish(); +# while(my ($group, $path) = $sth->fetchrow_array()) { +# $path =~ s/\/\*$//; +# my $perm = {}; +# $perm->{'GROUP'} = $group; +# $perm->{'PATH'} = $path; +# push @allowed_dbs, $perm; +# } +# $sth->finish(); if($LISTALLOWED) { for my $href ( @allowed_dbs ) { print "$href->{'PATH'}\n"; } - $dbh->disconnect(); +# $dbh->disconnect(); exit 0; } ## GUI mode if(!$M3U) { - my $gui = Gtk2::GladeXML->new('rhimport.glade'); + my $guixml = Gtk2::GladeXML->new('rhimport.glade'); + $guixml or die "can't load glade xml file"; +# my $widget = $guixml->get_widget('appwin'); +# $widget or die "can't find main GUI Widget"; + Gtk2->main; +# $dbh->disconnect(); exit 0; } @@ -83,5 +88,5 @@ if($DONTCONCAT) { print "Will import $M3U (concatenated), with user $user\n\n"; } -$dbh->disconnect(); +# $dbh->disconnect(); exit 0; |