X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Frss.inc.php;h=f292fe8c0d87203002d8d2b7580a3bdb9fc39bea;hb=e97df22eacc433a9982aad507f980b303d5fa2c1;hp=dfa0c43b6afd6b9a25d4d83fc5143f0082d88fe2;hpb=a7de4ef724d1a3b0bf978a50ce7cc9d23412c7a0;p=platal.git diff --git a/include/rss.inc.php b/include/rss.inc.php index dfa0c43..f292fe8 100644 --- a/include/rss.inc.php +++ b/include/rss.inc.php @@ -1,6 +1,6 @@ changeTpl($template, NO_SKIN); - $page->register_modifier('rss_date', '_rss_encode_date'); - $page->default_modifiers = Array('@to_rss'); - - $res = XDB::query( - 'SELECT a.id - FROM aliases AS a - INNER JOIN auth_user_quick AS q ON ( a.id = q.user_id AND q.core_rss_hash = {?} ) - WHERE a.alias = {?} AND a.type != "homonyme"', $hash, $alias); - $uid = $res->fetchOneCell(); - - if (empty($uid)) { + $user = Platal::session()->tokenAuth($alias, $hash); + if (is_null($user)) { if ($require_uid) { exit; } else { - $uid = null; + $user = null; } } - header('Content-Type: application/rss+xml; charset=utf8'); - return $uid; + if ($template) { + $page->assign('rss_hash', $hash); + pl_content_headers("application/rss+xml"); + } + return is_null($user) ? null : $user->id(); } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: