aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-02-14 15:32:33 -0800
committerzotlabs <mike@macgirvin.com>2018-02-14 15:32:33 -0800
commit465d89129caaaa0240229f8d6f81d68f26eb60b0 (patch)
tree2d547ae70a283f6cc0c92c10863b6c837f522d4d /Zotlabs
parent24da5d82db8316a54ccb41616e0e2acb5d73fc84 (diff)
downloadvolse-hubzilla-465d89129caaaa0240229f8d6f81d68f26eb60b0.tar.gz
volse-hubzilla-465d89129caaaa0240229f8d6f81d68f26eb60b0.tar.bz2
volse-hubzilla-465d89129caaaa0240229f8d6f81d68f26eb60b0.zip
provide option to block the public stream unless authenticated, since there could be legal issues with unmoderated content
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Apps.php9
-rw-r--r--Zotlabs/Module/Admin/Site.php4
-rw-r--r--Zotlabs/Module/Pubstream.php7
3 files changed, 15 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index d2a307fd5..f91dc8e49 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -119,6 +119,7 @@ class Apps {
static public function parse_app_description($f,$translate = true) {
+
$ret = array();
$baseurl = z_root();
@@ -194,6 +195,10 @@ class Apps {
if(! is_public_profile())
unset($ret);
break;
+ case 'public_stream':
+ if(! can_view_public_stream())
+ unset($ret);
+ break;
case 'observer':
if(! $observer)
unset($ret);
@@ -346,6 +351,10 @@ class Apps {
if(! is_public_profile())
return '';
break;
+ case 'public_stream':
+ if(! can_view_public_stream())
+ return '';
+ break;
case 'observer':
$observer = \App::get_observer();
if(! $observer)
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index 52b36e03e..ca181d5f8 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -45,6 +45,7 @@ class Site {
$force_publish = ((x($_POST,'publish_all')) ? True : False);
$disable_discover_tab = ((x($_POST,'disable_discover_tab')) ? False : True);
$site_firehose = ((x($_POST,'site_firehose')) ? True : False);
+ $open_pubstream = ((x($_POST,'open_pubstream')) ? True : False);
$login_on_homepage = ((x($_POST,'login_on_homepage')) ? True : False);
$enable_context_help = ((x($_POST,'enable_context_help')) ? True : False);
$global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : '');
@@ -139,6 +140,7 @@ class Site {
set_config('system','publish_all', $force_publish);
set_config('system','disable_discover_tab', $disable_discover_tab);
set_config('system','site_firehose', $site_firehose);
+ set_config('system','open_pubstream', $open_pubstream);
set_config('system','force_queue_threshold', $force_queue);
if ($global_directory == '') {
del_config('system', 'directory_submit_url');
@@ -319,7 +321,7 @@ class Site {
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
'$site_firehose' => array('site_firehose', t('Site only Public Streams'), get_config('system','site_firehose'), t('Allow access to public content originating only from this site if Imported Public Streams are disabled.')),
-
+ '$open_pubstream' => array('open_pubstream', t('Allow anybody on the internet to access the Public streams'), get_config('system','open_pubstream',1), t('Disable to require authentication before viewing. Warning: this content is unmoderated.')),
'$login_on_homepage' => array('login_on_homepage', t("Login on Homepage"),((intval($homelogin) || $homelogin === false) ? 1 : '') , t("Present a login box to visitors on the home page if no other content has been configured.")),
'$enable_context_help' => array('enable_context_help', t("Enable context help"),((intval($enable_context_help) === 1 || $enable_context_help === false) ? 1 : 0) , t("Display contextual help for the current page when the help button is pressed.")),
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index 16a5fdbba..afe53eca7 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -12,11 +12,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
if($load)
$_SESSION['loadtime'] = datetime_convert();
-
- if(observer_prohibited(true)) {
- return login();
+ if((observer_prohibited(true)) || (! (intval(get_config('system','open_pubstream',1))) && get_observer_hash())) {
+ return login();
}
-
+
$site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false);
$net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true);