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
930 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-13 09:26:02 +02:00
echo $db->getRowValue($row, 'id') .
2012-06-12 13:27:51 +02:00
"\t" . $db->getRowValue($row, 'active') .
"\t" . $db->getRowValue($row, 'created') .
"\t" . $db->getRowValue($row, 'secret') .
"\t" . $db->getRowValue($row, 'email') .
"\t" . $db->getRowValue($row, 'notes') .
"\t" . $db->getRowValue($row, 'otp') .
"\n";
2012-06-12 13:27:51 +02:00
}
$db->closeCursor($result);
$db->disconnect();
$result=null;
$db=null;
?>