From 32532f1c0f6a997060ee050654787b2bfa3329a6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 31 Oct 2012 16:15:29 +0400 Subject: [PATCH] improve status reporting for linked feeds --- classes/pref/instances.php | 8 ++++++++ include/functions.php | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/classes/pref/instances.php b/classes/pref/instances.php index c017ee9d..0ce39080 100644 --- a/classes/pref/instances.php +++ b/classes/pref/instances.php @@ -1,6 +1,12 @@ "Connection failed", + 1 => "Success", + 2 => "Invalid object received", + 16 => "Access denied" ); + function csrf_ignore($method) { $csrf_ignored = array("index", "edit"); @@ -167,6 +173,7 @@ class Pref_Instances extends Handler_Protected { ".__('Instance URL')." ".__('Access key')." ".__('Last connected')." + ".__('Status')." ".__('Stored feeds')." "; @@ -193,6 +200,7 @@ class Pref_Instances extends Handler_Protected { print "" . htmlspecialchars($line['access_url']) . ""; print "" . htmlspecialchars($access_key) . ""; print "" . htmlspecialchars($line['last_connected']) . ""; + print "" . $this->status_codes[$line['last_status_out']] . ""; print "" . htmlspecialchars($line['num_feeds']) . ""; print ""; diff --git a/include/functions.php b/include/functions.php index a81a2c0c..0e98b4a5 100644 --- a/include/functions.php +++ b/include/functions.php @@ -5124,6 +5124,12 @@ if ($feeds) { if ($feeds['error']) { $status = $feeds['error']['code'] + 10; + + // access denied + if ($status == 16) { + db_query($link, "DELETE FROM ttrss_linked_feeds + WHERE instance_id = '$id'"); + } } else { $status = 1; -- 2.39.5