Commit 6bdb1053 authored by Brion Vibber's avatar Brion Vibber

Pending members queue list -- doesn't yet allow approval.

parent 471a4805
This diff is collapsed.
......@@ -153,6 +153,36 @@ class User_group extends Memcached_DataObject
return $members;
}
/**
* Get pending members, who have not yet been approved.
*
* @param int $offset
* @param int $limit
* @return Profile
*/
function getRequests($offset=0, $limit=null)
{
$qry =
'SELECT profile.* ' .
'FROM profile JOIN group_join_queue '.
'ON profile.id = group_join_queue.profile_id ' .
'WHERE group_join_queue.group_id = %d ' .
'ORDER BY group_join_queue.created DESC ';
if ($limit != null) {
if (common_config('db','type') == 'pgsql') {
$qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
} else {
$qry .= ' LIMIT ' . $offset . ', ' . $limit;
}
}
$members = new Profile();
$members->query(sprintf($qry, $this->id));
return $members;
}
function getMemberCount()
{
// XXX: WORM cache this
......
......@@ -393,6 +393,10 @@ class Router
array('action' => 'makeadmin'),
array('nickname' => Nickname::DISPLAY_FMT));
$m->connect('group/:nickname/members/pending',
array('action' => 'groupqueue'),
array('nickname' => Nickname::DISPLAY_FMT));
$m->connect('group/:id/id',
array('action' => 'groupbyid'),
array('id' => '[0-9]+'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment