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

Refactor.

- make it easier to follow what is happenining in queue().
This commit is contained in:
Jean Paul Galea 2015-07-15 17:01:51 +02:00
parent 91e49cefd4
commit dfdc4610d6

View File

@ -133,22 +133,27 @@ class SyncLib
public function queue($otpParams, $localParams) public function queue($otpParams, $localParams)
{ {
$info = $this->createInfoString($otpParams, $localParams);
$info=$this->createInfoString($otpParams, $localParams);
$this->otpParams = $otpParams; $this->otpParams = $otpParams;
$this->localParams = $localParams; $this->localParams = $localParams;
$queued=time(); $queued=time();
$res=True; $res=True;
foreach ($this->syncServers as $server) {
if(! $this->db->save('queue', array('queued'=>$queued, foreach ($this->syncServers as $server) {
'modified'=>$otpParams['modified'], $arr = array(
'otp'=>$otpParams['otp'], 'queued' => $queued,
'server'=>$server, 'modified' => $otpParams['modified'],
'server_nonce'=>$this->server_nonce, 'otp' => $otpParams['otp'],
'info'=>$info))) $res=False; 'server' => $server,
'server_nonce' => $this->server_nonce,
'info' => $info
);
if (! $this->db->save('queue', $arr))
$res=False;
} }
return $res; return $res;
} }