2010-01-25 16:30:59 +01: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");
|
2010-01-25 16:39:59 +01:00
|
|
|
|
2010-01-25 16:30:59 +01:00
|
|
|
require_once 'ykval-config.php';
|
2011-10-31 11:11:14 +01:00
|
|
|
require_once 'ykval-db.php';
|
2010-01-25 16:30:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
$logname="ykval-export";
|
|
|
|
$myLog = new Log($logname);
|
|
|
|
|
2012-06-12 13:27:51 +02:00
|
|
|
$db = Db::GetDatabaseHandle($baseParams, $logname);
|
2010-01-25 16:30:59 +01:00
|
|
|
|
|
|
|
if (!$db->connect()) {
|
|
|
|
$myLog->log(LOG_WARNING, "Could not connect to database");
|
|
|
|
exit(1);
|
2012-05-29 11:07:19 +02:00
|
|
|
}
|
2010-01-25 16:30:59 +01:00
|
|
|
|
2010-01-25 18:00:42 +01:00
|
|
|
$result=$db->customQuery("SELECT active, created, modified, yk_publicname, yk_counter, yk_use, yk_low, yk_high, nonce, notes FROM yubikeys ORDER BY yk_publicname");
|
2012-06-12 10:35:49 +02:00
|
|
|
while($row = $db->fetchArray($result)){
|
2012-06-15 21:52:21 +02:00
|
|
|
echo (int)$row['active'] .
|
2012-06-28 14:55:00 +02:00
|
|
|
"\t" . $row['created'] .
|
|
|
|
"\t" . $row['modified'] .
|
|
|
|
"\t" . $row['yk_publicname'] .
|
|
|
|
"\t" . $row['yk_counter'] .
|
|
|
|
"\t" . $row['yk_use'] .
|
|
|
|
"\t" . $row['yk_low'] .
|
|
|
|
"\t" . $row['yk_high'] .
|
|
|
|
"\t" . $row['nonce'] .
|
|
|
|
"\t" . $row['notes'] .
|
2010-01-25 16:30:59 +01:00
|
|
|
"\n";
|
|
|
|
}
|
|
|
|
|
2012-06-12 10:35:49 +02:00
|
|
|
$db->closeCursor($result);
|
|
|
|
$db->disconnect();
|
2010-01-25 16:49:53 +01:00
|
|
|
$result=null;
|
2010-01-25 16:48:48 +01:00
|
|
|
$db=null;
|
2010-01-25 16:30:59 +01:00
|
|
|
|
|
|
|
|
2012-06-12 10:35:49 +02:00
|
|
|
?>
|