From b45327b856a3ce116931c6b554e23fc1bef20b7c Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Apr 2012 20:45:48 -0700 Subject: [PATCH 1/2] let's catch d* disabled at a higher level and not waste any resources on it. --- mod/receive.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mod/receive.php b/mod/receive.php index 950bf0bd38..2bd3cc65bc 100755 --- a/mod/receive.php +++ b/mod/receive.php @@ -12,6 +12,13 @@ require_once('include/diaspora.php'); function receive_post(&$a) { + + $enabled = intval(get_config('system','diaspora_enabled')); + if(! $enabled) { + logger('mod-diaspora: disabled'); + http_status_exit(500); + } + $public = false; if(($a->argc == 2) && ($a->argv[1] === 'public')) { From 37801dd6ed60776fc128d44f0d63a57e1b5e37d0 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Apr 2012 20:48:35 -0700 Subject: [PATCH 2/2] also block outbound --- include/diaspora.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/diaspora.php b/include/diaspora.php index 37d5990eee..06df9c24a4 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2283,6 +2283,11 @@ function diaspora_send_mail($item,$owner,$contact) { function diaspora_transmit($owner,$contact,$slap,$public_batch) { + $enabled = intval(get_config('system','diaspora_enabled')); + if(! $enabled) { + return 200; + } + $a = get_app(); $logid = random_string(4); $dest_url = (($public_batch) ? $contact['batch'] : $contact['notify']);