]> git.wh0rd.org Git - tt-rss.git/commitdiff
block unsubscribe requests for virtual feeds
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 18 Jan 2009 09:32:45 +0000 (10:32 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 18 Jan 2009 09:32:45 +0000 (10:32 +0100)
functions.php
modules/pref-feeds.php
tt-rss.js

index b7a6d5c46013f5ff28ee54f0c7e80bd97188e5ec..8a4fc6b4ce9a5336bcd46d20b0b5d08cf5c398b1 100644 (file)
 
        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')");
index 790555421ac25cf1eef3b0262307cf0f91a11277..ee4e4d1f8f1203093a9971f709c4e7f69ad3a227 100644 (file)
 
                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");
                                        }
                                }
                        }
index 7c5f8e0860609b3333c1cf9b3d7eb2007e40c828..8dda27720c337419f435c7ce7efb5777d535428a 100644 (file)
--- 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;