summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/apigrouplist.php15
-rw-r--r--actions/apigrouplistall.php11
-rw-r--r--actions/foaf.php2
-rw-r--r--actions/imsettings.php2
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) {