mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 01: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']];
|
||||
$this->log(LOG_INFO, "server=" . $entry['server'] . ", server_nonce=" . $entry['server_nonce'] . ", info=" . $entry['info']);
|
||||
|
||||
$url = $entry['server'] .
|
||||
"?otp=" . $entry['otp'] .
|
||||
"&modified=" . $entry['modified'] .
|
||||
"&" . $this->otpPartFromInfoString($entry['info']);
|
||||
$url = $this->buildSyncUrl($entry);
|
||||
|
||||
curl_settings($this, 'YK-VAL resync', $handle, $url, $timeout, $this->curlopts);
|
||||
$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']);
|
||||
|
||||
$url = $entry['server'] .
|
||||
"?otp=" . $entry['otp'] .
|
||||
"&modified=" . $entry['modified'] .
|
||||
"&" . $this->otpPartFromInfoString($entry['info']);
|
||||
$url = $this->buildSyncUrl($entry);
|
||||
|
||||
curl_settings($this, 'YK-VAL resync', $handle, $url, $timeout, $this->curlopts);
|
||||
$entries[$server] = $entry;
|
||||
@ -469,10 +463,7 @@ class SyncLib
|
||||
));
|
||||
foreach ($res as $row)
|
||||
{
|
||||
$urls[] = $row['server'] .
|
||||
"?otp=" . $row['otp'] .
|
||||
"&modified=" . $row['modified'] .
|
||||
"&" . $this->otpPartFromInfoString($row['info']);
|
||||
$urls[] = $this->buildSyncUrl($row);
|
||||
}
|
||||
|
||||
// send out requests
|
||||
@ -665,4 +656,12 @@ class SyncLib
|
||||
'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