mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-04-10 05:02:26 +02:00
Refactor.
- parse request before opening up a database connection and init'ing synclib.
This commit is contained in:
parent
552c3f8939
commit
7d4a2940d6
@ -54,13 +54,6 @@ if (in_array($ipaddr, $allowed, TRUE) === FALSE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sync = new SyncLib('ykval-sync:synclib');
|
|
||||||
$sync->addField('ip', $ipaddr);
|
|
||||||
|
|
||||||
if (! $sync->isConnected()) {
|
|
||||||
sendResp(S_BACKEND_ERROR, $myLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
// define requirements on protocol
|
// define requirements on protocol
|
||||||
$syncParams = array(
|
$syncParams = array(
|
||||||
'modified' => NULL,
|
'modified' => NULL,
|
||||||
@ -87,6 +80,13 @@ foreach ($syncParams as $param=>$value) {
|
|||||||
$myLog->log(LOG_INFO, $tmp_log);
|
$myLog->log(LOG_INFO, $tmp_log);
|
||||||
|
|
||||||
|
|
||||||
|
$sync = new SyncLib('ykval-sync:synclib');
|
||||||
|
$sync->addField('ip', $ipaddr);
|
||||||
|
|
||||||
|
if (! $sync->isConnected()) {
|
||||||
|
sendResp(S_BACKEND_ERROR, $myLog);
|
||||||
|
}
|
||||||
|
|
||||||
// at this point we should have the otp so let's add it to the logging module
|
// at this point we should have the otp so let's add it to the logging module
|
||||||
$myLog->addField('otp', $syncParams['otp']);
|
$myLog->addField('otp', $syncParams['otp']);
|
||||||
$sync->addField('otp', $syncParams['otp']);
|
$sync->addField('otp', $syncParams['otp']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user