]>
git.wh0rd.org - tt-rss.git/blob - opml.php
2 set_include_path(get_include_path() . PATH_SEPARATOR
.
3 dirname(__FILE__
) . "/include");
5 function __autoload($class) {
6 $file = "classes/".strtolower(basename($class)).".php";
7 if (file_exists($file)) {
12 require_once "functions.php";
13 require_once "sessions.php";
14 require_once "sanity_check.php";
15 require_once "config.php";
16 require_once "db.php";
17 require_once "db-prefs.php";
19 $link = db_connect(DB_HOST
, DB_USER
, DB_PASS
, DB_NAME
);
21 if (!init_connection($link)) return;
23 $op = $_REQUEST['op'];
25 if ($op == "publish"){
26 $key = db_escape_string($_REQUEST["key"]);
28 $result = db_query($link, "SELECT owner_uid
29 FROM ttrss_access_keys WHERE
30 access_key = '$key' AND feed_id = 'OPML:Publish'");
32 if (db_num_rows($result) == 1) {
33 $owner_uid = db_fetch_result($result, 0, "owner_uid");
35 $opml = new Opml($link, $_REQUEST);
36 $opml->opml_export("", $owner_uid, true, false);
39 print "<error>User not found</error>";