From 77fe1df52ea456586d3f2d5009aedf61691565cf Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Wed, 1 Apr 2009 16:29:07 +0000 Subject: [PATCH] Don't query twice. --- verify.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/verify.php b/verify.php index 920a3c9..0ac9574 100644 --- a/verify.php +++ b/verify.php @@ -85,12 +85,12 @@ $ad = getAuthData($conn, $devId); if (!is_array($ad)) { debug('Discovered Yubikey ' . $devId); addNewKey($conn, $devId); -} -$ad = getAuthData($conn, $devId); -if (!is_array($ad)) { - debug('Invalid Yubikey ' . $devId); - sendResp(S_BAD_OTP); - exit; + $ad = getAuthData($conn, $devId); + if (!is_array($ad)) { + debug('Invalid Yubikey ' . $devId); + sendResp(S_BAD_OTP); + exit; + } } debug($ad); if ($ad['active'] != 1) {