mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 01:52:18 +01:00
Refactor.
- avoid using $_SERVER vars in "core", helps when debugging or running via cli.
This commit is contained in:
parent
2aa06ec0a3
commit
937dd1a674
@ -33,8 +33,10 @@ require_once 'ykval-synclib.php';
|
||||
|
||||
header('content-type: text/plain');
|
||||
|
||||
$ipaddr = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
$myLog = new Log('ykval-verify');
|
||||
$myLog->addField('ip', $_SERVER['REMOTE_ADDR']);
|
||||
$myLog->addField('ip', $ipaddr);
|
||||
|
||||
$query_string = '';
|
||||
if ($_POST)
|
||||
@ -206,7 +208,7 @@ if ($sl && (preg_match("/^[0-9]+$/", $sl)==0 || ($sl<0 || $sl>100)))
|
||||
/* Initialize the sync library. Strive to use this instead of custom
|
||||
DB requests, custom comparisons etc */
|
||||
$sync = new SyncLib('ykval-verify:synclib');
|
||||
$sync->addField('ip', $_SERVER['REMOTE_ADDR']);
|
||||
$sync->addField('ip', $ipaddr);
|
||||
$sync->addField('otp', $otp);
|
||||
|
||||
if (! $sync->isConnected())
|
||||
|
Loading…
x
Reference in New Issue
Block a user