From: Art Cancro Date: Wed, 30 Jul 2003 20:36:18 +0000 (+0000) Subject: * Allow users to authenticate with either their display name or any valid X-Git-Tag: v7.86~5801 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=94834ddc72ce2a29571221b959b4daf5102401b2;p=citadel.git * Allow users to authenticate with either their display name or any valid e-mail address which belongs to them. Applies to all protocols. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 618076892..2bbe7eada 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 608.15 2003/07/30 20:36:18 ajc + * Allow users to authenticate with either their display name or any valid + e-mail address which belongs to them. Applies to all protocols. + Revision 608.14 2003/07/30 03:54:34 ajc * Fixed a small client bug in the purge hour setting @@ -4927,4 +4931,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/support.c b/citadel/support.c index f7f17f7f8..970a215fd 100644 --- a/citadel/support.c +++ b/citadel/support.c @@ -36,7 +36,7 @@ void strproc(char *string) for (a=0; a126) string[a]=32; - } + } /* Remove leading and trailing blanks */ while( (string[0]<33) && (strlen(string)>0) ) @@ -49,8 +49,8 @@ void strproc(char *string) if ((string[a]==32)&&(string[a+1]==32)) { strcpy(&string[a],&string[a+1]); a=0; - } } + } /* remove characters which would interfere with the network */ for (a=0; auser, username); + /* 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(trythisname); + if (valid != NULL) { + if (valid->num_local == 1) { + found_user = getuser(&CC->user, + valid->recp_local); + } + phree(valid); + } + } + + /* Did we find something? */ if (found_user == 0) { if (((CC->nologin)) && (CC->user.axlevel < 6)) { return login_too_many_users; @@ -386,8 +403,7 @@ void cmd_user(char *cmdbuf) int a; extract(username, cmdbuf, 0); - username[25] = 0; - strproc(username); + striplt(username); a = CtdlLoginExistingUser(username); switch (a) {