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