aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-22 17:52:30 -0700
committerredmatrix <git@macgirvin.com>2016-05-22 17:52:30 -0700
commit5e0698ba8731e7e4659a24c0ab4fa9c4a1aef173 (patch)
tree36b583cd45fd7ba27f505678a9a080a7894d7a1c /include
parentd7d347469c234e14d5d097fa3f6ab90f715324aa (diff)
downloadvolse-hubzilla-5e0698ba8731e7e4659a24c0ab4fa9c4a1aef173.tar.gz
volse-hubzilla-5e0698ba8731e7e4659a24c0ab4fa9c4a1aef173.tar.bz2
volse-hubzilla-5e0698ba8731e7e4659a24c0ab4fa9c4a1aef173.zip
turn the oft-repeated block_public ... check into a function observer_prohibited()
Diffstat (limited to 'include')
-rw-r--r--include/channel.php2
-rw-r--r--include/socgraph.php2
-rw-r--r--include/widgets.php8
3 files changed, 6 insertions, 6 deletions
diff --git a/include/channel.php b/include/channel.php
index 050c4824b..8f93ca16f 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1567,7 +1567,7 @@ function get_online_status($nick) {
$ret = array('result' => false);
- if(get_config('system','block_public') && ! local_channel() && ! remote_channel())
+ if(observer_prohibited())
return $ret;
$r = q("select channel_id, channel_hash from channel where channel_address = '%s' limit 1",
diff --git a/include/socgraph.php b/include/socgraph.php
index dffaa8923..4cb5600ec 100644
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -402,7 +402,7 @@ function poco($a,$extended = false) {
$system_mode = false;
- if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
+ if(observer_prohibited()) {
logger('mod_poco: block_public');
http_status_exit(401);
}
diff --git a/include/widgets.php b/include/widgets.php
index a158633ad..27f50e9be 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -12,13 +12,13 @@ require_once('include/attach.php');
function widget_profile($args) {
- $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
+ $block = observer_prohibited();
return profile_sidebar(App::$profile, $block, true);
}
function widget_zcard($args) {
- $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
+ $block = observer_prohibited();
$channel = channelx_by_n(App::$profile_uid);
return get_zcard($channel,get_observer_hash(),array('width' => 875));
}
@@ -369,7 +369,7 @@ function widget_fullprofile($arr) {
if(! App::$profile['profile_uid'])
return;
- $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
+ $block = observer_prohibited();
return profile_sidebar(App::$profile, $block);
}
@@ -379,7 +379,7 @@ function widget_shortprofile($arr) {
if(! App::$profile['profile_uid'])
return;
- $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
+ $block = observer_prohibited();
return profile_sidebar(App::$profile, $block, true, true);
}