public function process() { parent::process(); if ($this->photo->private && !$this->app->session->isLoggedIn()) { // TODO: this could be simplified by simply redirecting to // the secure page with the same uri. All of the setReferrer // could then be removed from PinholeLoginPage $this->app->replacePage('login'); $referer = 'photo/' . $this->photo->id; if ($this->getArgument('dimension_shortname') !== null) { $referer .= '/' . $this->getArgument('dimension_shortname'); } if (count($this->tag_list)) { $referer .= '?' . (string) $this->tag_list; } $this->app->getPage()->setReferrer($referer); } $this->comment_ui->process(); }