diff options
Diffstat (limited to 'mod/zfinger.php')
-rw-r--r-- | mod/zfinger.php | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/mod/zfinger.php b/mod/zfinger.php index 8e0a7d141..a3da62162 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -186,37 +186,46 @@ function zfinger_init(&$a) { $ret['site']['directory_mode'] = 'standalone'; if($dirmode != DIRECTORY_MODE_NORMAL) $ret['site']['directory_url'] = z_root() . '/dirsearch'; - $register_policy = intval(get_config('system','register_policy')); - if($register_policy == REGISTER_CLOSED) - $ret['site']['register_policy'] = 'closed'; - if($register_policy == REGISTER_APPROVE) - $ret['site']['register_policy'] = 'approve'; - if($register_policy == REGISTER_OPEN) - $ret['site']['register_policy'] = 'open'; - require_once('include/account.php'); - $ret['site']['accounts'] = account_total(); - require_once('include/identity.php'); - $ret['site']['channels'] = channel_total(); + // hide detailed site information if you're off the grid + if($dirmode != DIRECTORY_MODE_STANDALONE) { - $ret['site']['version'] = RED_PLATFORM . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']'; + $register_policy = intval(get_config('system','register_policy')); - $ret['site']['admin'] = get_config('system','admin_email'); - $visible_plugins = array(); - if(is_array($a->plugins) && count($a->plugins)) { - $r = q("select * from addon where hidden = 0"); - if($r) - foreach($r as $rr) - $visible_plugins[] = $rr['name']; - } + if($register_policy == REGISTER_CLOSED) + $ret['site']['register_policy'] = 'closed'; + if($register_policy == REGISTER_APPROVE) + $ret['site']['register_policy'] = 'approve'; + if($register_policy == REGISTER_OPEN) + $ret['site']['register_policy'] = 'open'; + + require_once('include/account.php'); + $ret['site']['accounts'] = account_total(); + + require_once('include/identity.php'); + $ret['site']['channels'] = channel_total(); + + + $ret['site']['version'] = RED_PLATFORM . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']'; - $ret['site']['plugins'] = $visible_plugins; - $ret['site']['sitehash'] = get_config('system','location_hash'); - $ret['site']['sitename'] = get_config('system','sitename'); + $ret['site']['admin'] = get_config('system','admin_email'); + $visible_plugins = array(); + if(is_array($a->plugins) && count($a->plugins)) { + $r = q("select * from addon where hidden = 0"); + if($r) + foreach($r as $rr) + $visible_plugins[] = $rr['name']; + } + + $ret['site']['plugins'] = $visible_plugins; + $ret['site']['sitehash'] = get_config('system','location_hash'); + $ret['site']['sitename'] = get_config('system','sitename'); + + } json_return_and_die($ret); }
\ No newline at end of file |