#!/usr/bin/php connect()) { $myLog->log(LOG_WARNING, "Could not connect to database"); exit(1); } $everything = ""; $result=$db->customQuery("SELECT id, active, secret ". "FROM clients ". "ORDER BY id"); while($row = $db->fetchArray($result)) { $active = $db->getRowValue($row, 'active'); if ($active == "") { # For some reason PostgreSQL returns empty strings for false values?! $active = "0"; } $everything = $everything . $db->getRowValue($row, 'id') . "\t" . $active . "\t" . $db->getRowValue($row, 'secret') . "\n"; } $db->closeCursor($result); $hash = sha1 ($everything); if ($verbose) { print $everything; } print substr ($hash, 0, 10) . "\n"; $result=null; $db=null; ?>