]>
Commit | Line | Data |
---|---|---|
1d3a17c7 | 1 | <?php |
88e8fb3a AD |
2 | set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . |
3 | get_include_path()); | |
107d0cf3 | 4 | |
404e2e36 | 5 | require_once "autoload.php"; |
fb074239 | 6 | require_once "functions.php"; |
1559e374 | 7 | require_once "sessions.php"; |
66581886 | 8 | require_once "sanity_check.php"; |
9a4506c8 | 9 | require_once "config.php"; |
8158c57a | 10 | require_once "db.php"; |
a0111294 | 11 | require_once "db-prefs.php"; |
9a4506c8 | 12 | |
0a13e84e | 13 | $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); |
9f311df6 | 14 | |
ba68b681 | 15 | if (!init_plugins($link)) return; |
4e9f5c24 | 16 | |
d75409bf | 17 | $op = $_REQUEST['op']; |
0a13e84e | 18 | |
442f326b | 19 | if ($op == "publish"){ |
3972bf59 | 20 | $key = db_escape_string($link, $_REQUEST["key"]); |
86e26f1a | 21 | |
2e7f046f AD |
22 | $result = db_query($link, "SELECT owner_uid |
23 | FROM ttrss_access_keys WHERE | |
24 | access_key = '$key' AND feed_id = 'OPML:Publish'"); | |
86e26f1a MK |
25 | |
26 | if (db_num_rows($result) == 1) { | |
2e7f046f | 27 | $owner_uid = db_fetch_result($result, 0, "owner_uid"); |
e9558345 | 28 | |
d75409bf AD |
29 | $opml = new Opml($link, $_REQUEST); |
30 | $opml->opml_export("", $owner_uid, true, false); | |
9f311df6 | 31 | |
d75409bf AD |
32 | } else { |
33 | print "<error>User not found</error>"; | |
c03cf250 | 34 | } |
9f311df6 AD |
35 | } |
36 | ||
d75409bf | 37 | db_close($link); |
d2a317e3 | 38 | |
9a4506c8 | 39 | ?> |