add connection list and connection detail to fresh
This commit is contained in:
parent
c0c5252b57
commit
740edcfdb6
24
util/fresh
24
util/fresh
@ -109,6 +109,30 @@ function process_command($line) {
|
||||
echo 'Channel not found.';
|
||||
}
|
||||
break;
|
||||
case 'conn':
|
||||
if(! local_user()) {
|
||||
echo "Permission denied.";
|
||||
break;
|
||||
}
|
||||
if(argc > 1) {
|
||||
for($x = 1; $x < argc; $x ++) {
|
||||
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d",
|
||||
intval(argv($x)),
|
||||
intval(local_user())
|
||||
);
|
||||
if($r) echo jindent(json_encode($r[0]));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d",
|
||||
intval(local_user())
|
||||
);
|
||||
if($r) {
|
||||
foreach($r as $rr)
|
||||
echo $rr['abook_id'] . "\t" . $rr['xchan_name'] . "\n";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user