mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 01:52:18 +01:00
refactoring. removed unneccessary SQL query
This commit is contained in:
parent
12bd456dca
commit
e5b6a9d5bb
@ -28,7 +28,7 @@ class SyncLibTest extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$sl = new SyncLib();
|
$sl = new SyncLib();
|
||||||
$this->assertGreaterThan(1, $sl->getNumberOfServers());
|
$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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,9 +187,8 @@ class SyncLib
|
|||||||
|
|
||||||
public function updateDbCounters($params)
|
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($params['yk_publicname'])) {
|
||||||
if (isset($res['yk_publicname'])) {
|
|
||||||
$condition='('.$params['yk_counter'].'>yk_counter or ('.$params['yk_counter'].'=yk_counter and ' .
|
$condition='('.$params['yk_counter'].'>yk_counter or ('.$params['yk_counter'].'=yk_counter and ' .
|
||||||
$params['yk_use'] . '>yk_use))' ;
|
$params['yk_use'] . '>yk_use))' ;
|
||||||
if(! $this->db->conditionalUpdateBy('yubikeys', 'yk_publicname', $params['yk_publicname'],
|
if(! $this->db->conditionalUpdateBy('yubikeys', 'yk_publicname', $params['yk_publicname'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user