diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-09-29 00:51:49 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-09-29 00:51:49 (GMT) |
commit | 59bd1cedd11b6337259578cc15319da5d52e6d22 (patch) | |
tree | 92eab84af02de3085c4c19ce1b66097cd321b3e3 /lib/RHRD | |
parent | 97c41e8f8472e02c379a495065a4432abd941971 (diff) |
added list_groups
Diffstat (limited to 'lib/RHRD')
-rwxr-xr-x | lib/RHRD/rddb.pm | 22 |
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 |