ttrss/opml.php

39 lines
876 B
PHP
Raw Normal View History

2006-08-19 07:04:45 +00:00
<?php
set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
get_include_path());
2011-12-11 19:59:25 +00:00
require_once "functions.php";
2007-03-02 11:46:43 +00:00
require_once "sessions.php";
require_once "sanity_check.php";
2005-09-02 10:18:45 +00:00
require_once "config.php";
2005-09-07 13:31:21 +00:00
require_once "db.php";
2005-11-16 17:18:15 +00:00
require_once "db-prefs.php";
2005-09-02 10:18:45 +00:00
2011-04-05 15:07:19 +00:00
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
2005-09-02 11:49:47 +00:00
2013-04-17 10:23:35 +00:00
if (!init_plugins($link)) 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"){
$key = db_escape_string($link, $_REQUEST["key"]);
$result = db_query($link, "SELECT owner_uid
FROM ttrss_access_keys WHERE
access_key = '$key' AND feed_id = 'OPML:Publish'");
if (db_num_rows($result) == 1) {
$owner_uid = db_fetch_result($result, 0, "owner_uid");
2012-08-15 11:47:13 +00:00
$opml = new Opml($link, $_REQUEST);
$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>";
}
2005-09-02 11:49:47 +00:00
}
2012-08-15 11:47:13 +00:00
db_close($link);
2005-09-02 10:18:45 +00:00
?>