diff --git a/ykval-revoke.php b/ykval-revoke.php new file mode 100644 index 0000000..a6c8cee --- /dev/null +++ b/ykval-revoke.php @@ -0,0 +1,47 @@ +connect(); + +# Check if key exists +$r = $db->findBy('yubikeys', 'yk_publicname', $yk, 1); +if ($db->rowCount($r) != 1) { + logdie("ERROR Unknown yubikey: $yk"); +} + +# Enable/Disable the yubikey +if (!$db->updateBy('yubikeys', 'yk_publicname', $yk, + array('active'=>($do == "enable" ? "TRUE" : "FALSE")))) { + logdie("ERROR Could not $do for $yk (rows $rows)"); +} + +# We are done +logdie("OK Processed $yk with $do"); +?>