From b639461d8719bc8e8faa43737c32fc6e0eeb1dc4 Mon Sep 17 00:00:00 2001 From: Paul Chen Date: Fri, 10 Oct 2008 01:15:22 +0000 Subject: [PATCH] upd history on validation --- verifyOTP.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/verifyOTP.php b/verifyOTP.php index 1957509..a71d9d4 100644 --- a/verifyOTP.php +++ b/verifyOTP.php @@ -152,7 +152,7 @@ if ($scDiff == 0 && $hiDiff == 0 && $loDiff >= 0) { //// Update the DB only upon validation success // -if (updDB($ad['id'], $decoded_token)) { +if (updDB($ad['id'], $decoded_token, $client)) { debug('Validation database updated'); sendResp(S_OK); } else { @@ -182,7 +182,7 @@ function sendResp($status, $info=null) { } // End sendResp -function updDB($keyid, $new) { +function updDB($keyid, $new, $client) { $stmt = 'UPDATE yubikeys SET '. 'accessed=NOW(),'. 'counter='.$new['session_counter'].','. @@ -195,6 +195,9 @@ function updDB($keyid, $new) { writeLog($err); return false; } + + addHist(0, $_SERVER['REMOTE_ADDR'] , $keyid, $client); + return true; }