diff options
Diffstat (limited to 'rhimport.pm')
-rw-r--r-- | rhimport.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rhimport.pm b/rhimport.pm index 2c3130b..d44c34b 100644 --- a/rhimport.pm +++ b/rhimport.pm @@ -45,9 +45,14 @@ sub check_key_file sub get_dropboxes { - my ($dbh, $user) = @_; + my ($dbh, $user, $group) = @_; - my $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH,DROPBOXES.TO_CART,GROUPS.DESCRIPTION from USER_PERMS, DROPBOXES, GROUPS where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME and DROPBOXES.GROUP_NAME=GROUPS.NAME;}; + my $sql = ""; + if($group) { + $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH,DROPBOXES.TO_CART,GROUPS.DESCRIPTION from USER_PERMS, DROPBOXES, GROUPS where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME and DROPBOXES.GROUP_NAME=GROUPS.NAME and DROPBOXES.GROUP_NAME='$group';}; + } else { + $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH,DROPBOXES.TO_CART,GROUPS.DESCRIPTION from USER_PERMS, DROPBOXES, GROUPS where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME and DROPBOXES.GROUP_NAME=GROUPS.NAME;}; + } my $sth = $dbh->prepare($sql); $sth->execute(); my @allowed_dbs; |