validate_recipients() - completed removal of unused param
[citadel.git] / citadel / server / user_ops.c
index d05d0ef3dad8e544330894ceb17ee0a6ad4dd469..e35b00a27e71b222b20c5f3772b9b7aaac255552 100644 (file)
@@ -391,16 +391,15 @@ void rebuild_usersbynumber(void) {
 //                     Returns 0 if user was found
 int getuserbyuid(struct ctdluser *usbuf, uid_t number) {
 
-       struct cdbdata cdbus;
+       struct cdbkeyval cdbus;
        struct ctdluser *usptr;
        int return_value = (-1);
 
-       // Yes, we do this the long way.
+       // 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
-       // TODO: make an index
        cdb_rewind(CDB_USERS);
-       while (cdbus = cdb_next_item(CDB_USERS), cdbus.ptr!=NULL) {
-               usptr = (struct ctdluser *) cdbus.ptr;
+       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) {
                        syslog(LOG_DEBUG, "user_ops: found uid=%d username=%s", usptr->uid, usptr->fullname);
@@ -506,7 +505,7 @@ int CtdlLoginExistingUser(const char *trythisname) {
        
                // 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);
@@ -1031,7 +1030,7 @@ int CtdlForgetThisRoom(void) {
 // Traverse the user file and perform a callback for each user record.
 // (New improved version that runs in two phases so that callbacks can perform writes without having a r/o cursor open)
 void ForEachUser(void (*CallBack) (char *, void *out_data), void *in_data) {
-       struct cdbdata cdbus;
+       struct cdbkeyval cdbus;
        struct ctdluser *usptr;
 
        Array *all_users = array_new(USERNAME_SIZE);
@@ -1041,11 +1040,10 @@ void ForEachUser(void (*CallBack) (char *, void *out_data), void *in_data) {
        }
 
 
-       cdb_rewind(CDB_USERS);
-
        // Phase 1 : build an array of all our user account names
-       while (cdbus = cdb_next_item(CDB_USERS), cdbus.ptr!=NULL) {
-               usptr = (struct ctdluser *) cdbus.ptr;
+       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);
                }