1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2024-11-29 00:24:13 +01:00
yubikey-val/ykval-export-clients

40 lines
814 B
Plaintext
Raw Normal View History

#!/usr/bin/php
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
require_once 'ykval-config.php';
require_once 'ykval-db.php';
$logname="ykval-export";
$myLog = new Log($logname);
2012-06-12 13:27:51 +02:00
$db = Db::GetDatabaseHandle($baseParams, $logname);
if (!$db->connect()) {
$myLog->log(LOG_WARNING, "Could not connect to database");
exit(1);
2012-05-29 11:07:19 +02:00
}
$result = $db->customQuery("select id, active, created, secret, email, notes, otp from clients order by id");
2012-06-12 13:27:51 +02:00
while($row = $db->fetchArray($result)) {
2012-06-28 14:55:00 +02:00
echo $row['id'] .
"," . (int)$row['active'] .
"," . $row['created'] .
"," . $row['secret'] .
"," . $row['email'] .
"," . $row['notes'] .
"," . $row['otp'] .
"\n";
2012-06-12 13:27:51 +02:00
}
$db->closeCursor($result);
$db->disconnect();
$result=null;
$db=null;
?>