From 65eebd13f41a18dab90447276faca4045990aac9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 26 Apr 2011 18:42:05 +0400 Subject: [PATCH] add option to disable PUSH client support globally (closes #340 --- config.php-dist | 10 +++++++--- functions.php | 2 +- modules/pref-feeds.php | 13 +++++++------ sanity_check.php | 2 +- sanity_config.php | 6 +++--- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/config.php-dist b/config.php-dist index 301b8856c..6ebcc1a11 100644 --- a/config.php-dist +++ b/config.php-dist @@ -178,14 +178,18 @@ // http://twitter.com/oauth_clients to register your instance. define('PUBSUBHUBBUB_HUB', ''); - // URL to a PubSubHubbub-compatible hub server. If defined, Published - // articles generated feeds would automatically become PUSH-enabled. + // URL to a PubSubHubbub-compatible hub server. If defined, "Published + // articles" generated feed would automatically become PUSH-enabled. + + define('PUBSUBHUBBUB_ENABLED', true); + // Enable client PubSubHubbub support in tt-rss. When disabled, tt-rss + // won't try to subscribe to PUSH feed updates. define('ISCONFIGURED', false); // Please set this to true if you have read everything above and // finished setting configuration options. - define('CONFIG_VERSION', 22); + define('CONFIG_VERSION', 23); // Expected config version. Please update this option in config.php // if necessary (after migrating all new options from this file). diff --git a/functions.php b/functions.php index aa50433e3..79318dc68 100644 --- a/functions.php +++ b/functions.php @@ -777,7 +777,7 @@ return; // no articles } - if ($pubsub_state != 2) { + if ($pubsub_state != 2 && PUBSUBHUBBUB_ENABLED) { if ($debug_enabled) _debug("update_rss_feed: checking for PUSH hub..."); diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 794916c87..5a65b0dd5 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -522,13 +522,14 @@ "; - $pubsub_state = db_fetch_result($result, 0, "pubsub_state"); + if (PUBSUBHUBBUB_ENABLED) { + $pubsub_state = db_fetch_result($result, 0, "pubsub_state"); + $pubsub_btn_disabled = ($pubsub_state == 2) ? "" : "disabled=\"1\""; - $pubsub_btn_disabled = ($pubsub_state == 2) ? "" : "disabled=\"1\""; - - print ""; + print ""; + } print ""; diff --git a/sanity_check.php b/sanity_check.php index 89f1b3459..930d68e00 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -1,7 +1,7 @@ +