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)
commit071dff71446b6a0004f77d33a026098bbc8a8176 (patch)
tree940ba75f81d7b132a892de6829b2edaa59c15e82 /rhimport.pm
parente48a008b44bd988288713ee60c96e459d7715738 (diff)
added rhimport for autoimporting democracy now!
git-svn-id: https://svn.helsinki.at/rhimport/trunk@70 7c65635b-ec39-4f67-a626-873dbafdd612
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;