let the site admin import a record directly from the probe diagnostic
This commit is contained in:
parent
61e205f593
commit
aeb69dcbbe
@ -15,6 +15,7 @@ function probe_content(&$a) {
|
|||||||
if(x($_GET,'addr')) {
|
if(x($_GET,'addr')) {
|
||||||
$channel = $a->get_channel();
|
$channel = $a->get_channel();
|
||||||
$addr = trim($_GET['addr']);
|
$addr = trim($_GET['addr']);
|
||||||
|
$do_import = ((intval($_GET['import']) && is_site_admin()) ? true : false);
|
||||||
$res = zot_finger($addr,$channel,false);
|
$res = zot_finger($addr,$channel,false);
|
||||||
$o .= '<pre>';
|
$o .= '<pre>';
|
||||||
if($res['success'])
|
if($res['success'])
|
||||||
@ -29,6 +30,8 @@ function probe_content(&$a) {
|
|||||||
$o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n");
|
$o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if($do_import && $j)
|
||||||
|
$x = import_xchan($j);
|
||||||
if($j && $j['permissions'] && $j['permissions']['iv'])
|
if($j && $j['permissions'] && $j['permissions']['iv'])
|
||||||
$j['permissions'] = json_decode(crypto_unencapsulate($j['permissions'],$channel['channel_prvkey']),true);
|
$j['permissions'] = json_decode(crypto_unencapsulate($j['permissions'],$channel['channel_prvkey']),true);
|
||||||
$o .= str_replace("\n",'<br />',print_r($j,true));
|
$o .= str_replace("\n",'<br />',print_r($j,true));
|
||||||
|
Reference in New Issue
Block a user