X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Frss.inc.php;h=9d38d3150c6cfd2053219269f245db7c74da6586;hb=01c0448f918d513f314951b0a6ab97f6b7f939aa;hp=0117fc0f65c814b715a6e5ecf3cf2a3a293cbdd0;hpb=e6bf921624e50f7abdd9a1862d0b7ef4f1053090;p=platal.git diff --git a/include/rss.inc.php b/include/rss.inc.php index 0117fc0..9d38d31 100644 --- a/include/rss.inc.php +++ b/include/rss.inc.php @@ -19,29 +19,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -function _rss_encode_date($d) { - if (preg_match('/^\d{14}$/', $d)) { - $t = mktime(substr($d,8,2), substr($d,10,2), substr($d,12,2), substr($d,4,2), substr($d,6,2), substr($d,0,4)); - } else { - $t = strtotime($d); - } - return date('r', $t); -} - function init_rss($template, $alias, $hash, $require_uid = true) { - global $page; + $page =& Platal::page(); $page->changeTpl($template, NO_SKIN); - $page->register_modifier('rss_date', '_rss_encode_date'); - - $res = XDB::query( - 'SELECT a.id - FROM aliases AS a - INNER JOIN auth_user_md5 AS u ON (a.id = u.user_id AND u.perms IN ("admin", "user")) - 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(); - + $uid = Platal::session()->tokenAuth($alias, $hash); if (empty($uid)) { if ($require_uid) { exit;