mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-27 06:54:16 +01:00
Merge branch 'master' of github.com:Yubico/yubikey-val-server-php
Conflicts: ykval-synclib.php
This commit is contained in:
commit
060b35453d
@ -4,8 +4,8 @@
|
|||||||
set_include_path(get_include_path() . PATH_SEPARATOR .
|
set_include_path(get_include_path() . PATH_SEPARATOR .
|
||||||
"/etc/ykval:/usr/share/ykval");
|
"/etc/ykval:/usr/share/ykval");
|
||||||
|
|
||||||
require_once 'ykval-synclib.php';
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
|
require_once 'ykval-synclib.php';
|
||||||
require_once 'ykval-log.php';
|
require_once 'ykval-log.php';
|
||||||
|
|
||||||
if ($argc==2 && strcmp($argv[1], "autoconf") == 0) {
|
if ($argc==2 && strcmp($argv[1], "autoconf") == 0) {
|
||||||
|
@ -106,13 +106,13 @@ foreach (array('yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param) {
|
|||||||
$yk_publicname = $syncParams['yk_publicname'];
|
$yk_publicname = $syncParams['yk_publicname'];
|
||||||
$localParams = $sync->getLocalParams($yk_publicname);
|
$localParams = $sync->getLocalParams($yk_publicname);
|
||||||
if (!$localParams) {
|
if (!$localParams) {
|
||||||
$myLog->log(LOG_NOTICE, 'Invalid Yubikey ' . $yk_publicname);
|
$myLog->log(LOG_NOTICE, 'Refusing sync of invalid Yubikey ' . $yk_publicname);
|
||||||
sendResp(S_BACKEND_ERROR, $apiKey);
|
sendResp(S_BACKEND_ERROR, $apiKey);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($localParams['active'] != 1) {
|
if ($localParams['active'] != 1) {
|
||||||
$myLog->log(LOG_NOTICE, 'De-activated Yubikey ' . $yk_publicname);
|
$myLog->log(LOG_NOTICE, 'Refusing sync of de-activated Yubikey ' . $yk_publicname);
|
||||||
sendResp(S_BAD_OTP, $apiKey);
|
sendResp(S_BAD_OTP, $apiKey);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -294,8 +294,8 @@ class SyncLib
|
|||||||
foreach ($res as $my_server) {
|
foreach ($res as $my_server) {
|
||||||
$this->log(LOG_INFO, "Sending queue request to server on server " . $my_server['server']);
|
$this->log(LOG_INFO, "Sending queue request to server on server " . $my_server['server']);
|
||||||
$res=$this->db->customQuery("select * from queue WHERE (queued < " . $queued_limit . " or queued is null) and server='" . $my_server['server'] . "'");
|
$res=$this->db->customQuery("select * from queue WHERE (queued < " . $queued_limit . " or queued is null) and server='" . $my_server['server'] . "'");
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
|
||||||
while ($entry=$res->fetch(PDO::FETCH_ASSOC)) {
|
while ($entry=$res->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$this->log(LOG_INFO, "server=" . $entry['server'] . " , info=" . $entry['info']);
|
$this->log(LOG_INFO, "server=" . $entry['server'] . " , info=" . $entry['info']);
|
||||||
$url=$entry['server'] .
|
$url=$entry['server'] .
|
||||||
@ -369,6 +369,8 @@ class SyncLib
|
|||||||
array("modified"=>$entry['modified'],
|
array("modified"=>$entry['modified'],
|
||||||
"server_nonce"=>$entry['server_nonce'],
|
"server_nonce"=>$entry['server_nonce'],
|
||||||
'server'=>$entry['server']));
|
'server'=>$entry['server']));
|
||||||
|
} else {
|
||||||
|
$this->log(LOG_ERR, "Remote server refused our sync request. Check remote server logs.");
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* End of loop over each queue entry for a server */
|
} /* End of loop over each queue entry for a server */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user