]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/public.php
Revert "Added configuration option to only allow OpenID logins."
[quix0rs-gnu-social.git] / actions / public.php
index ef9ef0d1ab0dc4ea451d29f1c1a016359533501c..15bedb7119b6f24cde6b29f8a9e2bb3d85bd69d3 100644 (file)
@@ -59,6 +59,7 @@ class PublicAction extends Action
      */
 
     var $page = null;
+    var $notice;
 
     function isReadOnly($args)
     {
@@ -84,6 +85,18 @@ class PublicAction extends Action
 
         common_set_returnto($this->selfUrl());
 
+        $this->notice = Notice::publicStream(($this->page-1)*NOTICES_PER_PAGE,
+                                       NOTICES_PER_PAGE + 1);
+
+        if (!$this->notice) {
+            $this->serverError(_('Could not retrieve public stream.'));
+            return;
+        }
+
+        if($this->page > 1 && $this->notice->N == 0){
+            $this->serverError(_('No such page'),$code=404);
+        }
+
         return true;
     }
 
@@ -101,8 +114,6 @@ class PublicAction extends Action
     {
         parent::handle($args);
 
-        header('X-XRDS-Location: '. common_local_url('publicxrds'));
-
         $this->showPage();
     }
 
@@ -143,22 +154,6 @@ class PublicAction extends Action
                               _('Public Stream Feed (Atom)')));
     }
 
-    /**
-     * Extra head elements
-     *
-     * We include a <meta> element linking to the publicxrds page, for OpenID
-     * client-side authentication.
-     *
-     * @return void
-     */
-
-    function extraHead()
-    {
-        // for client side of OpenID authentication
-        $this->element('meta', array('http-equiv' => 'X-XRDS-Location',
-                                     'content' => common_local_url('publicxrds')));
-    }
-
     /**
      * Show tabset for this page
      *
@@ -203,15 +198,7 @@ class PublicAction extends Action
 
     function showContent()
     {
-        $notice = Notice::publicStream(($this->page-1)*NOTICES_PER_PAGE,
-                                       NOTICES_PER_PAGE + 1);
-
-        if (!$notice) {
-            $this->serverError(_('Could not retrieve public stream.'));
-            return;
-        }
-
-        $nl = new NoticeList($notice, $this);
+        $nl = new NoticeList($this->notice, $this);
 
         $cnt = $nl->show();
 
@@ -229,7 +216,7 @@ class PublicAction extends Action
         // $top->show();
         $pop = new PopularNoticeSection($this);
         $pop->show();
-        $gbp = new GroupsByPostsSection($this);
+        $gbp = new GroupsByMembersSection($this);
         $gbp->show();
         $feat = new FeaturedUsersSection($this);
         $feat->show();