1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-08 03:54:20 +01:00

Refactor.

- improve readability.
This commit is contained in:
Jean Paul Galea 2015-07-17 00:29:22 +02:00
parent d61acc2a71
commit d502b644c0

View File

@ -252,23 +252,24 @@ function sendResp($status, $logger, $apiKey = '', $extra = null) {
$a['status'] = $status;
$a['t'] = getUTCTimeStamp();
if ($extra){
foreach ($extra as $param => $value) $a[$param] = $value;
}
if ($extra)
foreach ($extra as $param => $value)
$a[$param] = $value;
$h = sign($a, $apiKey, $logger);
$str = "h=" . $h . "\r\n";
$str .= "t=" . ($a['t']) . "\r\n";
$str .= "t=" . $a['t'] . "\r\n";
if ($extra){
foreach ($extra as $param => $value) {
$str .= $param . "=" . $value . "\r\n";
}
}
$str .= "status=" . ($a['status']) . "\r\n";
$str .= "status=" . $a['status'] . "\r\n";
$str .= "\r\n";
$logger->log(LOG_INFO, "Response: " . $str .
" (at " . date("c") . " " . microtime() . ")");
$logger->log(LOG_INFO, "Response: " . $str . " (at " . date("c") . " " . microtime() . ")");
echo $str;
exit;