mirror of
https://github.com/Yubico/yubikey-val.git
synced 2024-12-03 03:24:15 +01:00
Remove.
This commit is contained in:
parent
c088f09ac4
commit
eff489989b
@ -25,13 +25,6 @@ $baseParams['__YKVAL_SYNC_DEFAULT_TIMEOUT__'] = 1;
|
|||||||
|
|
||||||
$baseParams['__YKVAL_SYNC_MAX_SIMUL__'] = 50;
|
$baseParams['__YKVAL_SYNC_MAX_SIMUL__'] = 50;
|
||||||
|
|
||||||
# For the revoke service.
|
|
||||||
$baseParams['__YKR_DB_HOST__'] = $baseParams['__YKVAL_DB_HOST__'];
|
|
||||||
$baseParams['__YKR_DB_NAME__'] = $baseParams['__YKVAL_DB_NAME__'];
|
|
||||||
$baseParams['__YKR_DB_USER__'] = 'ykval_revoke';
|
|
||||||
$baseParams['__YKR_DB_PW__'] = 'thirdpassword';
|
|
||||||
$baseParams['__YKR_IP__'] = '1.2.3.4';
|
|
||||||
|
|
||||||
// otp2ksmurls: Return array of YK-KSM URLs for decrypting OTP for
|
// otp2ksmurls: Return array of YK-KSM URLs for decrypting OTP for
|
||||||
// CLIENT. The URLs must be fully qualified, i.e., contain the OTP
|
// CLIENT. The URLs must be fully qualified, i.e., contain the OTP
|
||||||
// itself.
|
// itself.
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'ykval-common.php';
|
|
||||||
require_once 'ykval-config.php';
|
|
||||||
|
|
||||||
header("content-type: text/plain");
|
|
||||||
|
|
||||||
debug("Request: " . $_SERVER['QUERY_STRING']);
|
|
||||||
|
|
||||||
if ($baseParams['__YKR_IP__'] != $_SERVER["REMOTE_ADDR"]) {
|
|
||||||
logdie("ERROR Authorization failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
# Connect to db
|
|
||||||
$conn = mysql_connect($baseParams['__YKR_DB_HOST__'],
|
|
||||||
$baseParams['__YKR_DB_USER__'],
|
|
||||||
$baseParams['__YKR_DB_PW__'])
|
|
||||||
or die('Could not connect to database: ' . mysql_error());
|
|
||||||
mysql_select_db($baseParams['__YKR_DB_NAME__'], $conn)
|
|
||||||
or die('Could not select database');
|
|
||||||
|
|
||||||
# Parse input
|
|
||||||
$yk = $_REQUEST["yk"];
|
|
||||||
$do = $_REQUEST["do"];
|
|
||||||
if (!$yk) {
|
|
||||||
logdie("ERROR Missing parameter");
|
|
||||||
}
|
|
||||||
if ($do != "enable" && $do != "disable") {
|
|
||||||
logdie("ERROR Unknown do value: $do");
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if key exists
|
|
||||||
$stmt = 'SELECT publicName FROM yubikeys WHERE publicName=' .
|
|
||||||
mysql_quote (modhex2b64($yk));
|
|
||||||
$r = query($conn, $stmt);
|
|
||||||
if (mysql_num_rows($r) != 1) {
|
|
||||||
logdie("ERROR Unknown yubikey $yk");
|
|
||||||
}
|
|
||||||
|
|
||||||
# Enable/Disable the yubikey
|
|
||||||
$stmt = 'UPDATE yubikeys SET active = ' .
|
|
||||||
($do == "enable" ? "TRUE" : "FALSE") .
|
|
||||||
' WHERE publicName=' . mysql_quote (modhex2b64($yk));
|
|
||||||
query($conn, $stmt);
|
|
||||||
$rows = mysql_affected_rows();
|
|
||||||
if ($rows != 1) {
|
|
||||||
logdie("ERROR Could not $do for $yk (rows $rows)");
|
|
||||||
}
|
|
||||||
|
|
||||||
# We are done
|
|
||||||
logdie("OK Processed $yk with $do");
|
|
||||||
?>
|
|
Loading…
Reference in New Issue
Block a user