X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fctdlproto%2Fserv_user.c;h=437f59633514c36f80e206537745fdb66a132726;hp=73465ab2647708275fcd3f45c3ab7ba039f2e67c;hb=f59e2e6772d87d323d065f09919ec0876bf2e0be;hpb=a2ae8dfea31fc1495e3a97b28f3ddca01f491bef diff --git a/citadel/modules/ctdlproto/serv_user.c b/citadel/modules/ctdlproto/serv_user.c index 73465ab26..437f59633 100644 --- a/citadel/modules/ctdlproto/serv_user.c +++ b/citadel/modules/ctdlproto/serv_user.c @@ -1,7 +1,7 @@ /* * Server functions which perform operations on user objects. * - * Copyright (c) 1987-2019 by the citadel.org team + * Copyright (c) 1987-2020 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, version 3. @@ -741,15 +741,20 @@ void cmd_asea(char *cmdbuf) cprintf("%d Ok\n", SEND_LISTING); while (client_getln(buf, sizeof buf) >= 0 && strcmp(buf, "000")) { - if ( // addresses must be: - (!IsEmptyStr(buf)) // non-empty - && ((strlen(new_emailaddrs) + strlen(buf) + 2) < sizeof(new_emailaddrs)) // fit in the remaining buffer - && (IsDirectory(buf, 0)) // in one of our own domains - && ( // not belong to someone else - (CtdlDirectoryLookup(whodat, buf, sizeof whodat) != 0) - || (!strcasecmp(whodat, requested_user)) - ) - ) { + if (IsEmptyStr(buf)) { + syslog(LOG_ERR, "user_ops: address <%s> is empty - not using", buf); + } + else if ((strlen(new_emailaddrs) + strlen(buf) + 2) > sizeof(new_emailaddrs)) { + syslog(LOG_ERR, "user_ops: address <%s> does not fit in buffer - not using", buf); + } + else if (!IsDirectory(buf, 0)) { + syslog(LOG_ERR, "user_ops: address <%s> is not in one of our domains - not using", buf); + } + else if ( (CtdlDirectoryLookup(whodat, buf, sizeof whodat) == 0) && (CtdlUserCmp(whodat, requested_user)) ) { + syslog(LOG_ERR, "user_ops: address <%s> already belongs to <%s> - not using", buf, whodat); + } + else { + syslog(LOG_DEBUG, "user_ops: address <%s> validated", buf); if (!IsEmptyStr(new_emailaddrs)) { strcat(new_emailaddrs, "|"); } @@ -757,7 +762,6 @@ void cmd_asea(char *cmdbuf) } } - CtdlSetEmailAddressesForUser(requested_user, new_emailaddrs); }