hide detailed site information if you're off the grid.
This commit is contained in:
parent
c5d456af9b
commit
1a624c10aa
@ -186,37 +186,46 @@ function zfinger_init(&$a) {
|
|||||||
$ret['site']['directory_mode'] = 'standalone';
|
$ret['site']['directory_mode'] = 'standalone';
|
||||||
if($dirmode != DIRECTORY_MODE_NORMAL)
|
if($dirmode != DIRECTORY_MODE_NORMAL)
|
||||||
$ret['site']['directory_url'] = z_root() . '/dirsearch';
|
$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();
|
|
||||||
|
|
||||||
|
|
||||||
$ret['site']['version'] = RED_PLATFORM . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']';
|
// hide detailed site information if you're off the grid
|
||||||
|
|
||||||
$ret['site']['admin'] = get_config('system','admin_email');
|
if($dirmode != DIRECTORY_MODE_STANDALONE) {
|
||||||
|
|
||||||
|
$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();
|
||||||
|
|
||||||
|
|
||||||
|
$ret['site']['version'] = RED_PLATFORM . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']';
|
||||||
|
|
||||||
|
$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');
|
||||||
|
|
||||||
$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);
|
json_return_and_die($ret);
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user