0) { debug('Key '.$keyid.' added'); reply(S_OK, $ci['secret'], $client, $nonce, $sn); } else { reply(S_BACKEND_ERROR, $ci['secret'], $client, $nonce); exit; } function reply($status, $apiKey, $client_id, $nonce, $sn='', $info='') { global $tokenId, $secret; if ($status == null) { $status = S_BACKEND_ERROR; } $a = array(); echo 'nonce='.($a['nonce'] = $nonce).PHP_EOL; echo 'status='.($a['status'] = $status).PHP_EOL; if ($info != '') { echo 'info='.($a['info'] = $info).PHP_EOL; } if ($sn != '') { echo 'sn='.$sn.PHP_EOL; } if ($tokenId != '') { echo 'token_id='.($a['token_id'] = $tokenId).PHP_EOL; echo 'user_id='.($a['user_id'] = $tokenId).PHP_EOL;//TODO } echo 't='.($a['t']=getUTCTimeStamp()).PHP_EOL; $h = sign($a, $apiKey); echo 'h='.$h.PHP_EOL; echo PHP_EOL; } // End reply ?>