honour block public setting - especially for standalones

This commit is contained in:
friendica
2015-02-03 15:16:03 -08:00
parent df632c4232
commit 36b756e4cd
3 changed files with 24 additions and 1 deletions

View File

@@ -12,7 +12,6 @@ function dirsearch_content(&$a) {
$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'));
@@ -22,6 +21,15 @@ function dirsearch_content(&$a) {
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') {
$ret = list_public_sites();
json_return_and_die($ret);