summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-29 00:51:49 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-29 00:51:49 (GMT)
commit59bd1cedd11b6337259578cc15319da5d52e6d22 (patch)
tree92eab84af02de3085c4c19ce1b66097cd321b3e3 /lib
parent97c41e8f8472e02c379a495065a4432abd941971 (diff)
added list_groups
Diffstat (limited to 'lib')
-rwxr-xr-xlib/RHRD/rddb.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm
index f8832d1..8fc2b3c 100755
--- a/lib/RHRD/rddb.pm
+++ b/lib/RHRD/rddb.pm
@@ -321,7 +321,7 @@ sub get_fullname
return ($fullname, 'OK', 'success');
}
-sub get_users
+sub list_users
{
my ($dbh) = @_;
@@ -606,6 +606,26 @@ sub remove_group_member
return ($cnt, 'OK', "success");
}
+sub list_groups
+{
+ my ($dbh) = @_;
+
+ my $sql = qq{select NAME from GROUPS order by DEFAULT_LOW_CART;};
+ my $sth = $dbh->prepare($sql)
+ or return (undef, 'ERROR', "Database Error: " . $dbh->errstr);
+
+ $sth->execute()
+ or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
+
+ my @groups;
+ while(my ($group) = $sth->fetchrow_array()) {
+ push @groups, $group;
+ }
+ $sth->finish();
+
+ return @groups;
+}
+
########################### SHOW handling ###########################
sub get_showtitle_and_log