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

42 lines
979 B
PHP
Raw Normal View History

2010-01-25 16:30:59 +01:00
#!/usr/bin/php
<?php
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';
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");
while($row = $db->fetchArray($result)){
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";
}
$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
?>