From: Andrew Dolgov Date: Sun, 18 Jan 2009 09:32:45 +0000 (+0100) Subject: block unsubscribe requests for virtual feeds X-Git-Tag: 1.3.0~95 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=810b15613569fcc92b40ada16b32d90f840e2d8a;p=tt-rss.git block unsubscribe requests for virtual feeds --- diff --git a/functions.php b/functions.php index b7a6d5c4..8a4fc6b4 100644 --- a/functions.php +++ b/functions.php @@ -1836,12 +1836,6 @@ function initialize_user($link, $uid) { -/* db_query($link, "insert into ttrss_labels (owner_uid,sql_exp,description) - values ('$uid','unread = true', 'Unread articles')"); - - db_query($link, "insert into ttrss_labels (owner_uid,sql_exp,description) - values ('$uid','last_read is null and unread = false', 'Updated articles')"); */ - db_query($link, "insert into ttrss_feeds (owner_uid,title,feed_url) values ('$uid', 'Tiny Tiny RSS: New Releases', 'http://tt-rss.org/releases.rss')"); diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 79055542..ee4e4d1f 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -703,28 +703,19 @@ if ($subop == "remove") { - if (!WEB_DEMO_MODE) { - - $ids = split(",", db_escape_string($_GET["ids"])); + $ids = split(",", db_escape_string($_GET["ids"])); - foreach ($ids as $id) { + foreach ($ids as $id) { - if ($id > 0) { + if ($id > 0) { - db_query($link, "DELETE FROM ttrss_feeds - WHERE id = '$id' AND owner_uid = " . $_SESSION["uid"]); + db_query($link, "DELETE FROM ttrss_feeds + WHERE id = '$id' AND owner_uid = " . $_SESSION["uid"]); - $icons_dir = ICONS_DIR; + $icons_dir = ICONS_DIR; - if (file_exists($icons_dir . "/$id.ico")) { - unlink($icons_dir . "/$id.ico"); - } - } else if ($id < -10) { - - $label_id = -$id - 11; - - db_query($link, "DELETE FROM ttrss_labels - WHERE id = '$label_id' AND owner_uid = " . $_SESSION["uid"]); + if (file_exists($icons_dir . "/$id.ico")) { + unlink($icons_dir . "/$id.ico"); } } } diff --git a/tt-rss.js b/tt-rss.js index 7c5f8e08..8dda2772 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -562,6 +562,11 @@ function quickMenuGo(opid) { return; } + if (actid <= 0) { + alert(__("You can't unsubscribe from this kind of feed.")); + return; + } + if (!actid) { alert(__("Please select some feed first.")); return;