You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
937 B
38 lines
937 B
<?php |
|
# |
|
function no_api() |
|
{ |
|
echo 'nil'; |
|
exit(0); |
|
} |
|
# |
|
function show_api($page, $menu, $name, $user) |
|
{ |
|
$u = getparam('username', true); |
|
$api = getparam('api', true); |
|
$ans = getAtts($u, 'KAPIKey.str'); |
|
if ($ans['STATUS'] != 'ok') |
|
no_api(); |
|
if (!isset($ans['KAPIKey.str'])) |
|
no_api(); |
|
if ($ans['KAPIKey.str'] != $api) |
|
no_api(); |
|
$ans = homeInfo($u); |
|
if ($ans === false) |
|
no_api(); |
|
$rep = fldEncode($ans, 'lastbc', true); |
|
$rep .= fldEncode($ans, 'lastheight', false); |
|
$rep .= fldEncode($ans, 'currndiff', false); |
|
$rep .= fldEncode($ans, 'lastblock', false); |
|
$rep .= fldEncode($ans, 'lastblockheight', false); |
|
$rep .= fldEncode($ans, 'blockacc', false); |
|
$rep .= fldEncode($ans, 'blockerr', false); |
|
$rep .= fldEncode($ans, 'p_hashrate5m', false); |
|
$rep .= fldEncode($ans, 'p_hashrate1hr', false); |
|
$rep .= fldEncode($ans, 'u_hashrate5m', false); |
|
$rep .= fldEncode($ans, 'u_hashrate1hr', false); |
|
echo $rep; |
|
exit(0); |
|
} |
|
# |
|
?>
|
|
|