summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-07-02 08:51:10 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-07-02 08:51:10 -0400
commit5f9a4ebef493997557ef4470268bed0e5799b6cb (patch)
treef9a06c1773e511d3273c5d9223d06ca0806d5341 /classes/User_group.php
parente52997e52fe02960908eb6a9637a3349a2c74dad (diff)
parentd04ab14a5a15f9119bedca1332eb516ecf5ca483 (diff)
Merge branch '0.8.x' into queuemanager
Diffstat (limited to 'classes/User_group.php')
-rw-r--r--classes/User_group.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index 9b4b01ead..27b444705 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -126,6 +126,30 @@ class User_group extends Memcached_DataObject
return $members;
}
+ function getAdmins($offset=0, $limit=null)
+ {
+ $qry =
+ 'SELECT profile.* ' .
+ 'FROM profile JOIN group_member '.
+ 'ON profile.id = group_member.profile_id ' .
+ 'WHERE group_member.group_id = %d ' .
+ 'AND group_member.is_admin = 1 ' .
+ 'ORDER BY group_member.modified ASC ';
+
+ if ($limit != null) {
+ if (common_config('db','type') == 'pgsql') {
+ $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+ } else {
+ $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+ }
+ }
+
+ $admins = new Profile();
+
+ $admins->query(sprintf($qry, $this->id));
+ return $admins;
+ }
+
function getBlocked($offset=0, $limit=null)
{
$qry =