// Yes, we do this the long way. Someday we might want to try an index.
// No, we don't use CtdlForEachUser() because that requires multiple reads for each record
cdb_rewind(CDB_USERS);
- while (cdbus = cdb_next_item(CDB_USERS), cdbus.val.ptr!=NULL) {
+ while (cdbus = cdb_next_item(CDB_USERS), cdbus.val.ptr!=NULL) { // always read through to the end
usptr = (struct ctdluser *) cdbus.val.ptr;
if (usptr->uid == number) {
}
- cdb_rewind(CDB_USERS);
-
// Phase 1 : build an array of all our user account names
- while (cdbus = cdb_next_item(CDB_USERS), cdbus.val.ptr!=NULL) {
+ cdb_rewind(CDB_USERS);
+ while (cdbus = cdb_next_item(CDB_USERS), cdbus.val.ptr!=NULL) { // always read through to the end
usptr = (struct ctdluser *) cdbus.val.ptr;
if (strlen(usptr->fullname) > 0) {
array_append(all_users, usptr->fullname);