1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-17 21:54:18 +01:00

Cosmetic changes.

This commit is contained in:
Jean Paul Galea 2015-07-17 23:25:52 +02:00
parent afc81e484a
commit 9869bfe84d

View File

@ -254,38 +254,39 @@ class SyncLib
return $resParams;
}
public function updateDbCounters($params)
{
if (isset($params['yk_publicname'])) {
$condition='('.$params['yk_counter'].'>yk_counter or ('.$params['yk_counter'].'=yk_counter and ' . $params['yk_use'] . '>yk_use))' ;
public function updateDbCounters($params)
{
if (isset($params['yk_publicname']))
{
$condition = '('.$params['yk_counter'].'>yk_counter or ('.$params['yk_counter'].'=yk_counter and ' . $params['yk_use'] . '>yk_use))';
$arr = array(
'modified' => $params['modified'],
'yk_counter' => $params['yk_counter'],
'yk_use' => $params['yk_use'],
'yk_low' => $params['yk_low'],
'yk_high' => $params['yk_high'],
'nonce' => $params['nonce']
);
$arr = array(
'modified' => $params['modified'],
'yk_counter' => $params['yk_counter'],
'yk_use' => $params['yk_use'],
'yk_low' => $params['yk_low'],
'yk_high' => $params['yk_high'],
'nonce' => $params['nonce']
);
if (! $this->db->conditionalUpdateBy('yubikeys', 'yk_publicname', $params['yk_publicname'], $arr, $condition))
{
$this->log(LOG_CRIT, 'failed to update internal DB with new counters');
return false;
}
else
{
if ($this->db->rowCount()>0)
$this->log(LOG_INFO, "updated database ", $params);
else
$this->log(LOG_INFO, 'database not updated', $params);
if (! $this->db->conditionalUpdateBy('yubikeys', 'yk_publicname', $params['yk_publicname'], $arr, $condition))
{
$this->log(LOG_CRIT, 'failed to update internal DB with new counters');
return false;
}
else
{
if ($this->db->rowCount() > 0)
$this->log(LOG_INFO, 'updated database ', $params);
else
$this->log(LOG_INFO, 'database not updated', $params);
return true;
}
}
return true;
}
}
return false;
}
return false;
}
public function countersHigherThan($p1, $p2)
{