X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpublic.php;h=ef9ef0d1ab0dc4ea451d29f1c1a016359533501c;hb=0dab5f58723cba8b5915c694a8200e242cc9ec02;hp=d2f9da6460f86d0decf408200fb9c4ab8f221e87;hpb=003c63e587128c6d095386c563c2615c2ac245c2;p=quix0rs-gnu-social.git diff --git a/actions/public.php b/actions/public.php index d2f9da6460..ef9ef0d1ab 100644 --- a/actions/public.php +++ b/actions/public.php @@ -35,6 +35,10 @@ require_once INSTALLDIR.'/lib/publicgroupnav.php'; require_once INSTALLDIR.'/lib/noticelist.php'; require_once INSTALLDIR.'/lib/feedlist.php'; +// Farther than any human will go + +define('MAX_PUBLIC_PAGE', 100); + /** * Action for displaying the public stream * @@ -74,6 +78,10 @@ class PublicAction extends Action parent::prepare($args); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; + if ($this->page > MAX_PUBLIC_PAGE) { + $this->clientError(sprintf(_("Beyond the page limit (%s)"), MAX_PUBLIC_PAGE)); + } + common_set_returnto($this->selfUrl()); return true; @@ -135,17 +143,6 @@ class PublicAction extends Action _('Public Stream Feed (Atom)'))); } - /** - * Output document relationship links - * - * @return void - */ - function showRelationshipLinks() - { - $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME - $this->page, 'public'); - } - /** * Extra head elements * @@ -185,8 +182,10 @@ class PublicAction extends Action $message .= _('Be the first to post!'); } else { - $message .= _('Why not [register an account](%%action.register%%) and be the first to post!'); - } + if (! (common_config('site','closed') || common_config('site','inviteonly'))) { + $message .= _('Why not [register an account](%%action.register%%) and be the first to post!'); + } + } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message));