- parent::prepare($args);
-
- $nickname_arg = $this->arg('nickname');
- $nickname = common_canonical_nickname($nickname_arg);
-
- // Permanent redirect on non-canonical nickname
-
- if ($nickname_arg != $nickname) {
- $args = array('nickname' => $nickname);
- if ($this->arg('page') && $this->arg('page') != 1) {
- $args['page'] = $this->arg['page'];
- }
- common_redirect(common_local_url('usergroups', $args), 301);
- return false;
- }
-
- $this->user = User::staticGet('nickname', $nickname);
-
- if (!$this->user) {
- // TRANS: Client error displayed requesting groups for a non-existing user.
- $this->clientError(_('No such user.'), 404);
- return false;
- }
-
- $this->profile = $this->user->getProfile();
-
- if (!$this->profile) {
- // TRANS: Error message displayed when referring to a user without a profile.
- $this->serverError(_('User has no profile.'));
- return false;
+ if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
+ $this->element('p', null,
+ // TRANS: Page notice for page with an overview of all subscribed groups
+ // TRANS: of the logged in user's own profile.
+ _('These are the groups whose notices '.
+ 'you listen to.'));
+ } else {
+ $this->element('p', null,
+ // TRANS: Page notice for page with an overview of all groups a user other
+ // TRANS: than the logged in user. %s is the user nickname.
+ sprintf(_('These are the groups whose '.
+ 'notices %s listens to.'),
+ $this->target->getNickname()));