// 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) {
// If that didn't work, try to log in as if the supplied name * is an e-mail address
if (found_user != 0) {
- valid = validate_recipients(username, NULL, 0);
+ valid = validate_recipients(username, 0);
if (valid != NULL) {
if (valid->num_local == 1) {
found_user = CtdlGetUser(&CC->user, valid->recp_local);
}
- 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);