honour block public setting - especially for standalones
This commit is contained in:
parent
df632c4232
commit
36b756e4cd
@ -12,7 +12,6 @@ function dirsearch_content(&$a) {
|
|||||||
|
|
||||||
$ret = array('success' => false);
|
$ret = array('success' => false);
|
||||||
|
|
||||||
// If you've got a public directory server, you probably shouldn't block public access
|
|
||||||
|
|
||||||
|
|
||||||
$dirmode = intval(get_config('system','directory_mode'));
|
$dirmode = intval(get_config('system','directory_mode'));
|
||||||
@ -22,6 +21,15 @@ function dirsearch_content(&$a) {
|
|||||||
json_return_and_die($ret);
|
json_return_and_die($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// If you've got a public directory server, you probably shouldn't block public access
|
||||||
|
|
||||||
|
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
|
||||||
|
$ret['message'] = 'permission denied';
|
||||||
|
json_return_and_die($ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(argc() > 1 && argv(1) === 'sites') {
|
if(argc() > 1 && argv(1) === 'sites') {
|
||||||
$ret = list_public_sites();
|
$ret = list_public_sites();
|
||||||
json_return_and_die($ret);
|
json_return_and_die($ret);
|
||||||
|
@ -4,6 +4,10 @@ require_once('include/dir_fns.php');
|
|||||||
|
|
||||||
function ratings_init(&$a) {
|
function ratings_init(&$a) {
|
||||||
|
|
||||||
|
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$dirmode = intval(get_config('system','directory_mode'));
|
$dirmode = intval(get_config('system','directory_mode'));
|
||||||
|
|
||||||
$x = find_upstream_directory($dirmode);
|
$x = find_upstream_directory($dirmode);
|
||||||
@ -57,6 +61,11 @@ function ratings_init(&$a) {
|
|||||||
|
|
||||||
function ratings_content(&$a) {
|
function ratings_content(&$a) {
|
||||||
|
|
||||||
|
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
|
||||||
|
notice( t('Public access denied.') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$poco_rating = get_config('system','poco_rating_enable');
|
$poco_rating = get_config('system','poco_rating_enable');
|
||||||
// if unset default to enabled
|
// if unset default to enabled
|
||||||
if($poco_rating === false)
|
if($poco_rating === false)
|
||||||
|
@ -12,6 +12,12 @@ function ratingsearch_init(&$a) {
|
|||||||
json_return_and_die($ret);
|
json_return_and_die($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
|
||||||
|
$ret['message'] = 'permission denied';
|
||||||
|
json_return_and_die($ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(argc() > 1)
|
if(argc() > 1)
|
||||||
$hash = argv(1);
|
$hash = argv(1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user