mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-27 06:54:16 +01:00
Cosmetic changes.
This commit is contained in:
parent
a0de5b9fd5
commit
fd5391bb91
@ -165,26 +165,31 @@ class SyncLib
|
|||||||
function getLocalParams($yk_publicname)
|
function getLocalParams($yk_publicname)
|
||||||
{
|
{
|
||||||
$this->log(LOG_DEBUG, "searching for yk_publicname $yk_publicname in local db");
|
$this->log(LOG_DEBUG, "searching for yk_publicname $yk_publicname in local db");
|
||||||
|
|
||||||
$res = $this->db->findBy('yubikeys', 'yk_publicname', $yk_publicname, 1);
|
$res = $this->db->findBy('yubikeys', 'yk_publicname', $yk_publicname, 1);
|
||||||
|
|
||||||
if (!$res) {
|
if (!$res)
|
||||||
|
{
|
||||||
$this->log(LOG_NOTICE, "Discovered new identity $yk_publicname");
|
$this->log(LOG_NOTICE, "Discovered new identity $yk_publicname");
|
||||||
|
|
||||||
$this->db->save('yubikeys', array(
|
$this->db->save('yubikeys', array(
|
||||||
'active'=>1,
|
'active' => 1,
|
||||||
'created'=>time(),
|
'created' => time(),
|
||||||
'modified'=>-1,
|
'modified' => -1,
|
||||||
'yk_publicname'=>$yk_publicname,
|
'yk_publicname' => $yk_publicname,
|
||||||
'yk_counter'=>-1,
|
'yk_counter' => -1,
|
||||||
'yk_use'=>-1,
|
'yk_use' => -1,
|
||||||
'yk_low'=>-1,
|
'yk_low' => -1,
|
||||||
'yk_high'=>-1,
|
'yk_high' => -1,
|
||||||
'nonce'=> '0000000000000000',
|
'nonce' => '0000000000000000',
|
||||||
'notes'=>''
|
'notes' => ''
|
||||||
));
|
));
|
||||||
$res=$this->db->findBy('yubikeys', 'yk_publicname', $yk_publicname,1);
|
|
||||||
|
$res = $this->db->findBy('yubikeys', 'yk_publicname', $yk_publicname, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($res) {
|
if ($res)
|
||||||
|
{
|
||||||
$localParams = array(
|
$localParams = array(
|
||||||
'modified' => $res['modified'],
|
'modified' => $res['modified'],
|
||||||
'nonce' => $res['nonce'],
|
'nonce' => $res['nonce'],
|
||||||
@ -198,7 +203,9 @@ class SyncLib
|
|||||||
|
|
||||||
$this->log(LOG_INFO, "yubikey found in db ", $localParams);
|
$this->log(LOG_INFO, "yubikey found in db ", $localParams);
|
||||||
return $localParams;
|
return $localParams;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$this->log(LOG_NOTICE, "params for yk_publicname $yk_publicname not found in database");
|
$this->log(LOG_NOTICE, "params for yk_publicname $yk_publicname not found in database");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user