summaryrefslogtreecommitdiff
path: root/opml.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-08 19:36:24 +0300
committerAndrew Dolgov <[email protected]>2010-11-08 19:36:24 +0300
commit2e7f046f65bd6d3a9417484bc4d6c9855cf39f7e (patch)
treeb9ddafc7d49fd7b125fa9231b6f1381d1d5ec745 /opml.php
parentf29033f86c41349237a9619137207083ea43a371 (diff)
make published OPML use common secret key code
Diffstat (limited to 'opml.php')
-rw-r--r--opml.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/opml.php b/opml.php
index 35e36d24a..98f4a95aa 100644
--- a/opml.php
+++ b/opml.php
@@ -134,15 +134,13 @@
if ($op == "publish"){
$key = db_escape_string($_REQUEST["key"]);
- $result = db_query($link, "SELECT login, owner_uid
- FROM ttrss_user_prefs, ttrss_users WHERE
- pref_name = '_PREFS_PUBLISH_KEY' AND
- value = '$key' AND
- ttrss_users.id = owner_uid");
+ $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 = db_fetch_result($result, 0, "owner_uid");
- return opml_export($link, $owner, true, false);
+ $owner_uid = db_fetch_result($result, 0, "owner_uid");
+ return opml_export($link, $owner_uid, true, false);
} else {
print "<error>User not found</error>";
}