diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-31 12:48:24 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-31 12:48:24 -0700 |
commit | df9eb4164aec6d63869dee7bfd5cfddf6d831618 (patch) | |
tree | c078b097143772da34a6660039e79e470f86325a /actions | |
parent | 89bb05311685d1bab404300e600f61deb954e18c (diff) | |
parent | 3ed88938b95804ecadc62ed3a5f61a0863e2ff78 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'actions')
-rw-r--r-- | actions/apigrouplist.php | 15 | ||||
-rw-r--r-- | actions/apigrouplistall.php | 11 | ||||
-rw-r--r-- | actions/foaf.php | 2 | ||||
-rw-r--r-- | actions/imsettings.php | 2 |
4 files changed, 19 insertions, 11 deletions
diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index 98fdb0497..dd2a68c66 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -66,7 +66,13 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::prepare($args); - $this->user = $this->getTargetUser($id); + $this->user = $this->getTargetUser(null); + + if (empty($this->user)) { + $this->clientError(_('No such user.'), 404, $this->format); + return false; + } + $this->groups = $this->getGroups(); return true; @@ -86,11 +92,6 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::handle($args); - if (empty($this->user)) { - $this->clientError(_('No such user.'), 404, $this->format); - return; - } - $sitename = common_config('site', 'name'); $title = sprintf(_("%s's groups"), $this->user->nickname); $taguribase = TagURI::base(); @@ -100,7 +101,7 @@ class ApiGroupListAction extends ApiBareAuthAction array('nickname' => $this->user->nickname) ); $subtitle = sprintf( - _("Groups %1$s is a member of on %2$s."), + _("Groups %1\$s is a member of on %2\$s."), $this->user->nickname, $sitename ); 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/actions/foaf.php b/actions/foaf.php index fc56e19b4..9cb65a885 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -126,7 +126,7 @@ class FoafAction extends Action $this->element('geo:lat', null, $location->lat); } if ($location->lon) { - $this->element('geo:long', null, $location->lat); + $this->element('geo:long', null, $location->lon); } if ($location->getURL()) { $this->element('page', array('rdf:resource'=>$location->getURL())); diff --git a/actions/imsettings.php b/actions/imsettings.php index af4915843..c3360fb12 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -292,7 +292,7 @@ class ImsettingsAction extends ConnectSettingsAction $this->showForm(_('Cannot normalize that Jabber ID')); return; } - if (!jabber_valid_base_jid($jabber)) { + if (!jabber_valid_base_jid($jabber, common_config('email', 'domain_check'))) { $this->showForm(_('Not a valid Jabber ID')); return; } else if ($user->jabber == $jabber) { |