X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fgroupmembers.php;h=54f1d8dcda748e8fb112c6042e9d4a14ac1f0ca7;hb=2b56d3b534389cba1d44c6f5ef4d1a8a514acda6;hp=f16e972a4194a6eee1a0fd60e2c4fad70881b36d;hpb=3cb6b1670bd7e3860fdca217e4075f51378fe5e0;p=quix0rs-gnu-social.git diff --git a/actions/groupmembers.php b/actions/groupmembers.php index f16e972a41..54f1d8dcda 100644 --- a/actions/groupmembers.php +++ b/actions/groupmembers.php @@ -77,7 +77,14 @@ class GroupmembersAction extends GroupDesignAction return false; } - $this->group = User_group::staticGet('nickname', $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); @@ -198,13 +205,13 @@ class GroupMemberListItem extends ProfileListItem !$this->profile->isAdmin($this->group)) { $this->out->elementStart('li', 'entity_make_admin'); $maf = new MakeAdminForm($this->out, $this->profile, $this->group, - array('action' => 'groupmembers', - 'nickname' => $this->group->nickname)); + $this->returnToArgs()); $maf->show(); $this->out->elementEnd('li'); } } + function showGroupBlockForm() { $user = common_current_user(); @@ -212,12 +219,49 @@ class GroupMemberListItem extends ProfileListItem if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group)) { $this->out->elementStart('li', 'entity_block'); $bf = new GroupBlockForm($this->out, $this->profile, $this->group, - array('action' => 'groupmembers', - 'nickname' => $this->group->nickname)); + $this->returnToArgs()); $bf->show(); $this->out->elementEnd('li'); } + } + + function linkAttributes() + { + $aAttrs = parent::linkAttributes(); + if (common_config('nofollow', 'members')) { + $aAttrs['rel'] .= ' nofollow'; + } + + return $aAttrs; + } + + function homepageAttributes() + { + $aAttrs = parent::linkAttributes(); + + if (common_config('nofollow', 'members')) { + $aAttrs['rel'] = 'nofollow'; + } + + return $aAttrs; + } + + /** + * Fetch necessary return-to arguments for the profile forms + * to return to this list when they're done. + * + * @return array + */ + protected function returnToArgs() + { + $args = array('action' => 'groupmembers', + 'nickname' => $this->group->nickname); + $page = $this->out->arg('page'); + if ($page) { + $args['param-page'] = $page; + } + return $args; } }