1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-04-12 02:02:25 +02:00
This commit is contained in:
Olov Danielson 2010-01-14 11:58:19 +00:00
parent bca5d339cb
commit 12bd456dca
4 changed files with 15 additions and 4 deletions

View File

@ -65,6 +65,12 @@ class Db
$this->myLog=new Log('ykval-db'); $this->myLog=new Log('ykval-db');
} }
function addField($name, $value)
{
$this->myLog->addField($name, $value);
}
/** /**
* function to convert Db timestamps to unixtime(s) * function to convert Db timestamps to unixtime(s)
* *

View File

@ -13,7 +13,7 @@ $myLog->addField('ip', $_SERVER['REMOTE_ADDR']);
$myLog->log(LOG_INFO, "Request: " . $_SERVER['QUERY_STRING']); $myLog->log(LOG_INFO, "Request: " . $_SERVER['QUERY_STRING']);
$sync = new SyncLib('ykval-sync:synclib'); $sync = new SyncLib('ykval-sync:synclib');
$sync->myLog->addField('ip', $_SERVER['REMOTE_ADDR']); $sync->addField('ip', $_SERVER['REMOTE_ADDR']);
if (! $sync->isConnected()) { if (! $sync->isConnected()) {
sendResp(S_BACKEND_ERROR, $apiKey); sendResp(S_BACKEND_ERROR, $apiKey);
@ -74,7 +74,7 @@ $myLog->log(LOG_INFO, $tmp_log);
# At this point we should have to otp so let's add it to the logging module # At this point we should have to otp so let's add it to the logging module
# #
$myLog->addField('otp', $syncParams['otp']); $myLog->addField('otp', $syncParams['otp']);
$sync->myLog->addField('otp', $syncParams['otp']); $sync->addField('otp', $syncParams['otp']);
# #
# Verify correctness of input parameters # Verify correctness of input parameters

View File

@ -25,6 +25,11 @@ class SyncLib
} }
function addField($name, $value)
{
$this->myLog->addField($name, $value);
$this->db->addField($name, $value);
}
function isConnected() function isConnected()
{ {
return $this->isConnected; return $this->isConnected;

View File

@ -22,7 +22,7 @@ $myLog->log(LOG_INFO, "found protocol version " . $protocol_version);
/* Initialize the sync library. Strive to use this instead of custom DB requests, /* Initialize the sync library. Strive to use this instead of custom DB requests,
custom comparisons etc */ custom comparisons etc */
$sync = new SyncLib('ykval-verify:synclib'); $sync = new SyncLib('ykval-verify:synclib');
$sync->myLog->addField('ip', $_SERVER['REMOTE_ADDR']); $sync->addField('ip', $_SERVER['REMOTE_ADDR']);
if (! $sync->isConnected()) { if (! $sync->isConnected()) {
sendResp(S_BACKEND_ERROR, $apiKey); sendResp(S_BACKEND_ERROR, $apiKey);
@ -40,7 +40,7 @@ $timestamp = getHttpVal('timestamp', 0);
/* We have the OTP now, so let's add it to the logging */ /* We have the OTP now, so let's add it to the logging */
$myLog->addField('otp', $otp); $myLog->addField('otp', $otp);
$sync->myLog->addField('otp', $otp); $sync->addField('otp', $otp);
if ($protocol_version>=2.0) { if ($protocol_version>=2.0) {