tt-rss/opml.php

38 lines
800 B
PHP
Raw Permalink Normal View History

2006-08-19 09:04:45 +02:00
<?php
set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
get_include_path());
2011-12-11 20:59:25 +01:00
2013-04-17 13:36:34 +02:00
require_once "autoload.php";
require_once "functions.php";
2007-03-02 12:46:43 +01:00
require_once "sessions.php";
require_once "sanity_check.php";
2005-09-02 12:18:45 +02:00
require_once "config.php";
2005-09-07 15:31:21 +02:00
require_once "db.php";
2005-11-16 18:18:15 +01:00
require_once "db-prefs.php";
2005-09-02 12:18:45 +02:00
2013-04-17 14:23:15 +02:00
if (!init_plugins()) return;
2005-12-01 07:10:39 +01:00
2012-08-15 13:47:13 +02:00
$op = $_REQUEST['op'];
2011-04-05 17:07:19 +02:00
2010-06-29 12:54:22 +02:00
if ($op == "publish"){
2017-12-02 09:42:42 +01:00
$key = $_REQUEST["key"];
$pdo = Db::pdo();
2017-12-02 09:42:42 +01:00
$sth = $pdo->prepare( "SELECT owner_uid
FROM ttrss_access_keys WHERE
2017-12-02 09:42:42 +01:00
access_key = ? AND feed_id = 'OPML:Publish'");
$sth->execute([$key]);
2017-12-02 09:42:42 +01:00
if ($row = $sth->fetch()) {
$owner_uid = $row['owner_uid'];
$opml = new Opml($_REQUEST);
2012-08-15 13:47:13 +02:00
$opml->opml_export("", $owner_uid, true, false);
2005-09-02 13:49:47 +02:00
2012-08-15 13:47:13 +02:00
} else {
print "<error>User not found</error>";
}
2005-09-02 13:49:47 +02:00
}
2005-09-02 12:18:45 +02:00
?>