1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-01-19 16:52:15 +01:00

refactoring. removed unneccessary SQL query

This commit is contained in:
Olov Danielson 2010-01-14 12:15:26 +00:00
parent 12bd456dca
commit e5b6a9d5bb
2 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,7 @@ class SyncLibTest extends PHPUnit_Framework_TestCase
{
$sl = new SyncLib();
$this->assertGreaterThan(1, $sl->getNumberOfServers());
$this->assertEquals($sl->getServer(0), "http://1.2.3.4/wsapi/2.0/sync");
$this->assertEquals($sl->getServer(0), "http://api2.example.com/wsapi/2.0/sync");
}

View File

@ -187,9 +187,8 @@ class SyncLib
public function updateDbCounters($params)
{
$res=$this->db->findBy('yubikeys', 'yk_publicname', $params['yk_publicname'], 1);
$this->log(LOG_INFO, 'yk_publicname is ' . $res['yk_publicname']);
if (isset($res['yk_publicname'])) {
if (isset($params['yk_publicname'])) {
$condition='('.$params['yk_counter'].'>yk_counter or ('.$params['yk_counter'].'=yk_counter and ' .
$params['yk_use'] . '>yk_use))' ;
if(! $this->db->conditionalUpdateBy('yubikeys', 'yk_publicname', $params['yk_publicname'],