X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=inline;f=classes%2Fplfeed.php;h=a8c51f20a0bcc2ae7dcf0a4e9f76ebd509c3e525;hb=31dc3dd3cdae22485061c3a1b6accdd732207dd4;hp=cd2d469f78f9d43c01d143788231ab0fea0186f2;hpb=9879250a1789b2b5819df3a11061ceb7307e3727;p=platal.git diff --git a/classes/plfeed.php b/classes/plfeed.php index cd2d469..a8c51f2 100644 --- a/classes/plfeed.php +++ b/classes/plfeed.php @@ -1,6 +1,6 @@ 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) { - $page->kill("Authentication required"); - } else { - $user = null; - } + if (empty($user) && $require_auth) { + return PL_FORBIDDEN; } $page->assign('rss_hash', $token); - header('Content-Type: application/rss+xml; charset=utf8'); + pl_content_headers("application/rss+xml"); $this->iterator = $this->fetch($user); $page->coreTpl('feed.' . $type . '.tpl', NO_SKIN); $page->assign_by_ref('feed', $this);