opml.php uid-aware

This commit is contained in:
Andrew Dolgov 2005-11-17 19:03:40 +01:00
parent b58cf26600
commit 5d3f29da4b
1 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,6 @@
<? <?
session_start();
// FIXME there are some brackets issues here // FIXME there are some brackets issues here
$op = $_REQUEST["op"]; $op = $_REQUEST["op"];
@ -11,6 +13,8 @@
require_once "db.php"; require_once "db.php";
require_once "db-prefs.php"; require_once "db-prefs.php";
$_SESSION["uid"] = PLACEHOLDER_UID; // FIXME: placeholder
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if (DB_TYPE == "pgsql") { if (DB_TYPE == "pgsql") {
@ -61,7 +65,7 @@
print "Feed <b>$title</b> ($url)... "; print "Feed <b>$title</b> ($url)... ";
$result = db_query($link, "SELECT id FROM ttrss_feeds WHERE $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE
title = '$title' OR feed_url = '$url'"); (title = '$title' OR feed_url = '$url') AND owner_uid = ".$_SESSION["uid"]);
if ($result && db_num_rows($result) > 0) { if ($result && db_num_rows($result) > 0) {
@ -69,8 +73,8 @@
} else { } else {
$result = db_query($link, "INSERT INTO ttrss_feeds (title, feed_url) VALUES $result = db_query($link, "INSERT INTO ttrss_feeds (title, feed_url,owner_uid) VALUES
('$title', '$url')"); ('$title', '$url', '".$_SESSION["uid"]."')");
print "<b>Done.</b><br>"; print "<b>Done.</b><br>";