X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Finternet_addressing.c;h=9cc6a7dbefa4fa4ec47b3031421f4d64adddf102;hb=fcec795dc7d0d125028ca1bd3a5f35b3f97b265f;hp=7730e8794e3039c99b051120959f7f8adb855d0f;hpb=5980aee9dfad00802b4e59fd8bd44ef197adf2b1;p=citadel.git diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 7730e8794..9cc6a7dbe 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -1718,3 +1718,36 @@ void CtdlRebuildDirectoryIndex(void) { ForEachUser(CtdlRebuildDirectoryIndex_backend, NULL); CtdlRebuildDirectoryIndex_backend(NULL, NULL); } + + +/* + * Configure Internet email addresses for a user account, updating the Directory Index in the process + */ +void CtdlSetEmailAddressesForUser(char *requested_user, char *new_emailaddrs) +{ + struct ctdluser usbuf; + int i; + char buf[SIZ]; + + if (CtdlGetUserLock(&usbuf, requested_user) != 0) { // We are relying on the fact that the DirectoryIndex functions don't lock. + return; // Silently fail here if we can't acquire a lock on the user record. + } + + syslog(LOG_DEBUG, "internet_addressing: setting email addresses for <%s> to <%s>", usbuf.fullname, new_emailaddrs); + + /* Delete all of the existing directory index records for the user (easier this way) */ + for (i=0; i