- return true;
- }
-
- function prepare($args)
- {
- parent::prepare($args);
-
- if (common_config('singleuser', 'enabled')) {
- $tagger_arg = User::singleUserNickname();
- } else {
- $tagger_arg = $this->arg('tagger');
- }
- $tag_arg = $this->arg('tag');
- $tagger = common_canonical_nickname($tagger_arg);
- $tag = common_canonical_tag($tag_arg);
-
- // Permanent redirect on non-canonical nickname
-
- if ($tagger_arg != $tagger || $tag_arg != $tag) {
- $args = array('tagger' => $nickname, 'tag' => $tag);
- if ($this->page != 1) {
- $args['page'] = $this->page;
- }
- common_redirect(common_local_url('showprofiletag', $args), 301);
- }
-
- if (!$tagger) {
- // TRANS: Client error displayed when a tagger is expected but not provided.
- $this->clientError(_('No tagger.'), 404);
- }
-
- $user = User::getKV('nickname', $tagger);
-
- if (!$user) {
- // TRANS: Client error displayed trying to perform an action related to a non-existing user.
- $this->clientError(_('No such user.'), 404);
- }
-
- $this->tagger = $user->getProfile();
- $this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag));
-
- $current = common_current_user();
- $can_see = !empty($this->peopletag) && (!$this->peopletag->private ||
- ($this->peopletag->private && $this->peopletag->tagger === $current->id));
-
- if (!$can_see) {