2010-01-25 16:30:59 +01:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
|
2010-01-25 16:41:13 +01:00
|
|
|
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/ykval:/etc/ykval");
|
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)){
|
|
|
|
echo $db->getRowValue($row, 'active') .
|
|
|
|
"\t" . $db->getRowValue($row, 'created') .
|
|
|
|
"\t" . $db->getRowValue($row, 'modified') .
|
|
|
|
"\t" . $db->getRowValue($row, 'yk_publicname') .
|
|
|
|
"\t" . $db->getRowValue($row, 'yk_counter') .
|
|
|
|
"\t" . $db->getRowValue($row, 'yk_use') .
|
|
|
|
"\t" . $db->getRowValue($row, 'yk_low') .
|
|
|
|
"\t" . $db->getRowValue($row, 'yk_high') .
|
|
|
|
"\t" . $db->getRowValue($row, 'nonce') .
|
|
|
|
"\t" . $db->getRowValue($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
|
|
|
?>
|