diff options
-rwxr-xr-x | rhimport | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -65,10 +65,10 @@ EOF exit; } -my $user = $ENV{'USER'}; -$user or die "Username not found in environment"; +my $user = `/usr/bin/id -un`; +$user =~ s/\n//; -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 $sth = $dbh->prepare($sql); $sth->execute(); |