2012-05-23 08:56:15 +02:00
|
|
|
#!/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);
|
2012-05-23 08:56:15 +02:00
|
|
|
|
|
|
|
if (!$db->connect()) {
|
|
|
|
$myLog->log(LOG_WARNING, "Could not connect to database");
|
|
|
|
exit(1);
|
2012-05-29 11:07:19 +02:00
|
|
|
}
|
2012-05-23 08:56:15 +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') .
|
2012-05-23 08:56:15 +02:00
|
|
|
"\n";
|
2012-06-12 13:27:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$db->closeCursor($result);
|
|
|
|
$db->disconnect();
|
2012-05-23 08:56:15 +02:00
|
|
|
|
|
|
|
$result=null;
|
|
|
|
$db=null;
|
|
|
|
|
|
|
|
|
|
|
|
?>
|