2006-08-19 09:04:45 +02:00
|
|
|
<?php
|
2012-12-09 10:41:22 +01:00
|
|
|
set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
|
|
|
|
get_include_path());
|
2011-12-11 20:59:25 +01:00
|
|
|
|
2012-08-15 13:47:13 +02:00
|
|
|
function __autoload($class) {
|
|
|
|
$file = "classes/".strtolower(basename($class)).".php";
|
|
|
|
if (file_exists($file)) {
|
|
|
|
require $file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-10 11:14:44 +01:00
|
|
|
require_once "functions.php";
|
2007-03-02 12:46:43 +01:00
|
|
|
require_once "sessions.php";
|
2005-11-23 18:20:17 +01:00
|
|
|
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
|
|
|
|
2011-04-05 17:07:19 +02:00
|
|
|
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
2005-09-02 13:49:47 +02:00
|
|
|
|
2011-12-13 11:49:11 +01:00
|
|
|
if (!init_connection($link)) 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"){
|
2010-04-10 03:31:51 +02:00
|
|
|
$key = db_escape_string($_REQUEST["key"]);
|
|
|
|
|
2010-11-08 17:36:24 +01:00
|
|
|
$result = db_query($link, "SELECT owner_uid
|
|
|
|
FROM ttrss_access_keys WHERE
|
|
|
|
access_key = '$key' AND feed_id = 'OPML:Publish'");
|
2010-04-10 03:31:51 +02:00
|
|
|
|
|
|
|
if (db_num_rows($result) == 1) {
|
2010-11-08 17:36:24 +01:00
|
|
|
$owner_uid = db_fetch_result($result, 0, "owner_uid");
|
2010-06-29 12:26:10 +02:00
|
|
|
|
2012-08-15 13:47:13 +02:00
|
|
|
$opml = new Opml($link, $_REQUEST);
|
|
|
|
$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>";
|
2007-11-17 10:23:44 +01:00
|
|
|
}
|
2005-09-02 13:49:47 +02:00
|
|
|
}
|
|
|
|
|
2012-08-15 13:47:13 +02:00
|
|
|
db_close($link);
|
2012-08-15 13:03:40 +02:00
|
|
|
|
2005-09-02 12:18:45 +02:00
|
|
|
?>
|