mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 10:52:18 +01:00
put building syncurl in a function
This commit is contained in:
parent
2a0f74c78d
commit
ba0d6fc193
@ -315,10 +315,7 @@ class SyncLib
|
|||||||
$handle = $ch[$entry['server']];
|
$handle = $ch[$entry['server']];
|
||||||
$this->log(LOG_INFO, "server=" . $entry['server'] . ", server_nonce=" . $entry['server_nonce'] . ", info=" . $entry['info']);
|
$this->log(LOG_INFO, "server=" . $entry['server'] . ", server_nonce=" . $entry['server_nonce'] . ", info=" . $entry['info']);
|
||||||
|
|
||||||
$url = $entry['server'] .
|
$url = $this->buildSyncUrl($entry);
|
||||||
"?otp=" . $entry['otp'] .
|
|
||||||
"&modified=" . $entry['modified'] .
|
|
||||||
"&" . $this->otpPartFromInfoString($entry['info']);
|
|
||||||
|
|
||||||
curl_settings($this, 'YK-VAL resync', $handle, $url, $timeout, $this->curlopts);
|
curl_settings($this, 'YK-VAL resync', $handle, $url, $timeout, $this->curlopts);
|
||||||
$entries[$entry['server']] = $entry;
|
$entries[$entry['server']] = $entry;
|
||||||
@ -432,10 +429,7 @@ class SyncLib
|
|||||||
}
|
}
|
||||||
$this->log(LOG_INFO, "server=" . $entry['server'] . ", server_nonce=" . $entry['server_nonce'] . ", info=" . $entry['info']);
|
$this->log(LOG_INFO, "server=" . $entry['server'] . ", server_nonce=" . $entry['server_nonce'] . ", info=" . $entry['info']);
|
||||||
|
|
||||||
$url = $entry['server'] .
|
$url = $this->buildSyncUrl($entry);
|
||||||
"?otp=" . $entry['otp'] .
|
|
||||||
"&modified=" . $entry['modified'] .
|
|
||||||
"&" . $this->otpPartFromInfoString($entry['info']);
|
|
||||||
|
|
||||||
curl_settings($this, 'YK-VAL resync', $handle, $url, $timeout, $this->curlopts);
|
curl_settings($this, 'YK-VAL resync', $handle, $url, $timeout, $this->curlopts);
|
||||||
$entries[$server] = $entry;
|
$entries[$server] = $entry;
|
||||||
@ -469,10 +463,7 @@ class SyncLib
|
|||||||
));
|
));
|
||||||
foreach ($res as $row)
|
foreach ($res as $row)
|
||||||
{
|
{
|
||||||
$urls[] = $row['server'] .
|
$urls[] = $this->buildSyncUrl($row);
|
||||||
"?otp=" . $row['otp'] .
|
|
||||||
"&modified=" . $row['modified'] .
|
|
||||||
"&" . $this->otpPartFromInfoString($row['info']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// send out requests
|
// send out requests
|
||||||
@ -665,4 +656,12 @@ class SyncLib
|
|||||||
'server' => $server
|
'server' => $server
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function buildSyncUrl($entry)
|
||||||
|
{
|
||||||
|
return $entry['server'] .
|
||||||
|
"?otp=" . $entry['otp'] .
|
||||||
|
"&modified=" . $entry['modified'] .
|
||||||
|
"&" . $this->otpPartFromInfoString($entry['info']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user