summaryrefslogtreecommitdiff
path: root/actions/foafgroup.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-25 08:44:15 -0500
committerEvan Prodromou <evan@status.net>2010-02-25 08:44:15 -0500
commite6858d7203bd36923f6251968bede6f4b271bf84 (patch)
treedaf24ce51064058af226eb8e296476a3f9155473 /actions/foafgroup.php
parentddc3671b6aeb0b543d261251a1740a53469684c3 (diff)
modify group actions so they use Local_group to look up by nickname
Diffstat (limited to 'actions/foafgroup.php')
-rw-r--r--actions/foafgroup.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/actions/foafgroup.php b/actions/foafgroup.php
index f5fd7fe88..ebdf1cee2 100644
--- a/actions/foafgroup.php
+++ b/actions/foafgroup.php
@@ -56,7 +56,14 @@ class FoafGroupAction extends Action
return false;
}
- $this->group = User_group::staticGet('nickname', $this->nickname);
+ $local = Local_group::staticGet('nickname', $nickname);
+
+ if (!$local) {
+ $this->clientError(_('No such group.'), 404);
+ return false;
+ }
+
+ $this->group = User_group::staticGet('id', $local->group_id);
if (!$this->group) {
$this->clientError(_('No such group.'), 404);
@@ -113,7 +120,7 @@ class FoafGroupAction extends Action
if ($this->group->homepage_logo) {
$this->element('depiction', array('rdf:resource' => $this->group->homepage_logo));
}
-
+
$members = $this->group->getMembers();
$member_details = array();
while ($members->fetch()) {
@@ -123,7 +130,7 @@ class FoafGroupAction extends Action
);
$this->element('member', array('rdf:resource' => $member_uri));
}
-
+
$admins = $this->group->getAdmins();
while ($admins->fetch()) {
$admin_uri = common_local_url('userbyid', array('id'=>$admins->id));
@@ -132,7 +139,7 @@ class FoafGroupAction extends Action
}
$this->elementEnd('Group');
-
+
ksort($member_details);
foreach ($member_details as $uri => $details) {
if ($details['is_admin'])
@@ -158,7 +165,7 @@ class FoafGroupAction extends Action
));
}
}
-
+
$this->elementEnd('rdf:RDF');
$this->endXML();
}