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

40 lines
809 B
PHP
Raw Normal View History

#!/usr/bin/php
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/ykval:/etc/ykval");
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'] .
"\t" . (int)$row['active'] .
2012-06-28 14:55:00 +02:00
"\t" . $row['created'] .
"\t" . $row['secret'] .
"\t" . $row['email'] .
"\t" . $row['notes'] .
"\t" . $row['otp'] .
"\n";
2012-06-12 13:27:51 +02:00
}
$db->closeCursor($result);
$db->disconnect();
$result=null;
$db=null;
?>