mirror of
https://github.com/friendica/friendica
synced 2024-11-14 05:02:54 +00:00
Merge pull request #1619 from rabuzarus/block-local-dir
block local directory for public access
This commit is contained in:
commit
a36014fb0f
3 changed files with 7 additions and 2 deletions
|
@ -94,3 +94,7 @@ $a->config['system']['lockpath'] = "";
|
||||||
|
|
||||||
// Use the old style "share"
|
// Use the old style "share"
|
||||||
// $a->config['system']['old_share'] = false;
|
// $a->config['system']['old_share'] = false;
|
||||||
|
|
||||||
|
//Deny public access to the local directory
|
||||||
|
//$a->config['system']['block_local_dir'] = false;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@ function directory_content(&$a) {
|
||||||
|
|
||||||
require_once("mod/proxy.php");
|
require_once("mod/proxy.php");
|
||||||
|
|
||||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) ||
|
||||||
|
(get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
|
||||||
notice( t('Public access denied.') . EOL);
|
notice( t('Public access denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ function poco_init(&$a) {
|
||||||
|
|
||||||
$system_mode = false;
|
$system_mode = false;
|
||||||
|
|
||||||
if(intval(get_config('system','block_public')))
|
if(intval(get_config('system','block_public')) || (get_config('system','block_local_dir')))
|
||||||
http_status_exit(401);
|
http_status_exit(401);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue