2012-05-23 08:56:15 +02:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
|
2013-01-28 12:24:39 +01:00
|
|
|
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
|
2012-05-23 08:56:15 +02:00
|
|
|
|
|
|
|
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);
|
2012-05-23 08:56:15 +02:00
|
|
|
|
|
|
|
if (!$db->connect()) {
|
|
|
|
$myLog->log(LOG_WARNING, "Could not connect to database");
|
|
|
|
exit(1);
|
2012-05-29 11:07:19 +02:00
|
|
|
}
|
2012-05-23 08:56:15 +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'] .
|
2013-01-28 16:24:23 +01:00
|
|
|
"," . (int)$row['active'] .
|
|
|
|
"," . $row['created'] .
|
|
|
|
"," . $row['secret'] .
|
|
|
|
"," . $row['email'] .
|
|
|
|
"," . $row['notes'] .
|
|
|
|
"," . $row['otp'] .
|
2012-05-23 08:56:15 +02:00
|
|
|
"\n";
|
2012-06-12 13:27:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$db->closeCursor($result);
|
|
|
|
$db->disconnect();
|
2012-05-23 08:56:15 +02:00
|
|
|
|
|
|
|
$result=null;
|
|
|
|
$db=null;
|
|
|
|
|
|
|
|
|
|
|
|
?>
|