summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/apigrouplistall.php11
-rw-r--r--lib/apiaction.php1
2 files changed, 9 insertions, 3 deletions
diff --git a/actions/apigrouplistall.php b/actions/apigrouplistall.php
index e1b54a832..f7677970f 100644
--- a/actions/apigrouplistall.php
+++ b/actions/apigrouplistall.php
@@ -66,7 +66,7 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
{
parent::prepare($args);
- $this->user = $this->getTargetUser($id);
+ $this->user = $this->getTargetUser(null);
$this->groups = $this->getGroups();
return true;
@@ -137,11 +137,18 @@ class ApiGroupListAllAction extends ApiPrivateAuthAction
$qry = 'SELECT user_group.* '.
'from user_group join local_group on user_group.id = local_group.group_id '.
'order by created desc ';
-
+ $offset = intval($this->page - 1) * intval($this->count);
+ $limit = intval($this->count);
+ if (common_config('db', 'type') == 'pgsql') {
+ $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+ } else {
+ $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+ }
$group = new User_group();
$group->query($qry);
+ $groups = array();
while ($group->fetch()) {
$groups[] = clone($group);
}
diff --git a/lib/apiaction.php b/lib/apiaction.php
index 9fc1a0779..59dc47c23 100644
--- a/lib/apiaction.php
+++ b/lib/apiaction.php
@@ -318,7 +318,6 @@ class ApiAction extends Action
$twitter_group['url']=$group->permalink();
$twitter_group['nickname']=$group->nickname;
$twitter_group['fullname']=$group->fullname;
- $twitter_group['homepage_url']=$group->homepage_url;
$twitter_group['original_logo']=$group->original_logo;
$twitter_group['homepage_logo']=$group->homepage_logo;
$twitter_group['stream_logo']=$group->stream_logo;