]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/foafgroup.php
Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / actions / foafgroup.php
index f5fd7fe885e993adb4e2fa1fe64b468a3d6bdb81..4db40c28bef2529e7407065bb837490e50abfc5e 100644 (file)
@@ -56,7 +56,14 @@ class FoafGroupAction extends Action
             return false;
         }
 
-        $this->group = User_group::staticGet('nickname', $this->nickname);
+        $local = Local_group::staticGet('nickname', $this->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,17 +120,18 @@ 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()) {
             $member_uri = common_local_url('userbyid', array('id'=>$members->id));
             $member_details[$member_uri] = array(
-                                        'nickname' => $members->nickname
+                                        'nickname' => $members->nickname,
+                                        'is_admin' => false,
                                         );
             $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,14 +140,14 @@ class FoafGroupAction extends Action
         }
 
         $this->elementEnd('Group');
-        
+
         ksort($member_details);
         foreach ($member_details as $uri => $details) {
             if ($details['is_admin'])
             {
                 $this->elementStart('Agent', array('rdf:about' => $uri));
                 $this->element('nick', null, $details['nickname']);
-                $this->elementStart('holdsAccount');
+                $this->elementStart('account');
                 $this->elementStart('sioc:User', array('rdf:about'=>$uri.'#acct'));
                 $this->elementStart('sioc:has_function');
                 $this->elementStart('statusnet:GroupAdminRole');
@@ -147,7 +155,7 @@ class FoafGroupAction extends Action
                 $this->elementEnd('statusnet:GroupAdminRole');
                 $this->elementEnd('sioc:has_function');
                 $this->elementEnd('sioc:User');
-                $this->elementEnd('holdsAccount');
+                $this->elementEnd('account');
                 $this->elementEnd('Agent');
             }
             else
@@ -158,7 +166,7 @@ class FoafGroupAction extends Action
                                         ));
             }
         }
-        
+
         $this->elementEnd('rdf:RDF');
         $this->endXML();
     }
@@ -170,4 +178,4 @@ class FoafGroupAction extends Action
         $this->elementEnd('Document');
     }
 
-}
\ No newline at end of file
+}