summaryrefslogtreecommitdiff
path: root/rhimport.pm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-07-19 14:41:15 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-07-19 14:41:15 (GMT)
commita7ab7560194ceb5789fa9ada05831ee832e4f95b (patch)
tree940ba75f81d7b132a892de6829b2edaa59c15e82 /rhimport.pm
parent5b7e717eb91aba37b30c12b3e47ef68592166fbe (diff)
added rhimport for autoimporting democracy now!
Diffstat (limited to 'rhimport.pm')
-rw-r--r--rhimport.pm9
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;