Merge remote branch 'origin/core/1.1.2/maint' into core/master
[platal.git] / classes / plfeed.php
index 19be252..74d6bea 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -69,7 +69,7 @@ abstract class PlFeed implements PlIterator
 
     /** Fetch the feed for the given user.
      */
-    abstract protected function fetch(PlUser &$user);
+    abstract protected function fetch(PlUser $user);
 
     public function next()
     {
@@ -95,15 +95,10 @@ abstract class PlFeed implements PlIterator
         return $this->iterator->last();
     }
 
-    public function run(PlPage& $page, $login, $token, $require_auth = true, $type = 'rss2')
+    public function run(PlPage $page, PlUser $user, $require_auth = true, $type = 'rss2')
     {
-        $user = Platal::session()->tokenAuth($login, $token);
-        if (empty($user)) {
-            if ($require_auth) {
-                return PL_FORBIDDEN;
-            } else {
-                $user = null;
-            }
+        if (empty($user) && $require_auth) {
+            return PL_FORBIDDEN;
         }
 
         $page->assign('rss_hash', $token);