From 3bb42d117027ebf610481ca3b0733854e0127e56 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 3 Mar 2010 19:00:02 +0000 Subject: Use poster's subscribed groups to disambiguate group linking when a remote group and a local group exist with the same name. (If you're a member of two groups with the same name though, there's not a defined winner.) --- classes/User.php | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'classes/User.php') diff --git a/classes/User.php b/classes/User.php index 57d76731b..aa9fbf948 100644 --- a/classes/User.php +++ b/classes/User.php @@ -612,28 +612,8 @@ class User extends Memcached_DataObject function getGroups($offset=0, $limit=null) { - $qry = - 'SELECT user_group.* ' . - 'FROM user_group JOIN group_member '. - 'ON user_group.id = group_member.group_id ' . - 'WHERE group_member.profile_id = %d ' . - 'ORDER BY group_member.created DESC '; - - if ($offset>0 && !is_null($limit)) { - if ($offset) { - if (common_config('db','type') == 'pgsql') { - $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; - } else { - $qry .= ' LIMIT ' . $offset . ', ' . $limit; - } - } - } - - $groups = new User_group(); - - $cnt = $groups->query(sprintf($qry, $this->id)); - - return $groups; + $profile = $this->getProfile(); + return $profile->getGroups($offset, $limit); } function getSubscriptions($offset=0, $limit=null) -- cgit v1.2.3-54-g00ecf