From e64af41cd413a41e7c469b7aa9802af0958b272f Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Mon, 22 Feb 2010 13:28:01 +0000 Subject: [PATCH] Add. --- ykval-revoke.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 ykval-revoke.php 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"); +?>