From 3b4735d34dd2d79f3bad62f370d58ab909f7bc39 Mon Sep 17 00:00:00 2001 From: Jean Paul Galea Date: Wed, 15 Jul 2015 16:46:06 +0200 Subject: [PATCH] Cosmetic changes. --- ykval-synclib.php | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/ykval-synclib.php b/ykval-synclib.php index a523d26..dc2d9b4 100644 --- a/ykval-synclib.php +++ b/ykval-synclib.php @@ -193,14 +193,16 @@ class SyncLib $res=$this->db->findBy('yubikeys', 'yk_publicname', $yk_publicname,1); } if ($res) { - $localParams=array('modified' => $res['modified'], - 'nonce' => $res['nonce'], - 'active' => $res['active'], - 'yk_publicname' => $yk_publicname, - 'yk_counter' => $res['yk_counter'], - 'yk_use' => $res['yk_use'], - 'yk_high' => $res['yk_high'], - 'yk_low' => $res['yk_low']); + $localParams = array( + 'modified' => $res['modified'], + 'nonce' => $res['nonce'], + 'active' => $res['active'], + 'yk_publicname' => $yk_publicname, + 'yk_counter' => $res['yk_counter'], + 'yk_use' => $res['yk_use'], + 'yk_high' => $res['yk_high'], + 'yk_low' => $res['yk_low'] + ); $this->log(LOG_INFO, "yubikey found in db ", $localParams); return $localParams; @@ -305,16 +307,18 @@ class SyncLib public function deleteQueueEntry($answer) { - preg_match('/url=(.*)\?/', $answer, $out); $server=$out[1]; + $this->log(LOG_INFO, "deleting server=" . $server . - " modified=" . $this->otpParams['modified'] . - " server_nonce=" . $this->server_nonce); - $this->db->deleteByMultiple('queue', - array("modified"=>$this->otpParams['modified'], - "server_nonce"=>$this->server_nonce, - 'server'=>$server)); + " modified=" . $this->otpParams['modified'] . + " server_nonce=" . $this->server_nonce); + + $this->db->deleteByMultiple('queue', array( + 'modified' => $this->otpParams['modified'], + 'server_nonce' => $this->server_nonce, + 'server' => $server + )); } public function reSync($older_than=60, $timeout)