e-mail address which belongs to them. Applies to all protocols.
$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
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
for (a=0; a<strlen(string); ++a) {
if (string[a]<32) string[a]=32;
if (string[a]>126) string[a]=32;
- }
+ }
/* Remove leading and trailing blanks */
while( (string[0]<33) && (strlen(string)>0) )
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; a<strlen(string); ++a) {
while (string[a]==',') strcpy(&string[a],&string[a+1]);
while (string[a]=='%') strcpy(&string[a],&string[a+1]);
while (string[a]=='|') strcpy(&string[a],&string[a+1]);
- }
-
}
+}
+
/*
{
char username[SIZ];
int found_user;
+ struct recptypes *valid = NULL;
if (trythisname == NULL) return login_not_found;
safestrncpy(username, trythisname, sizeof username);
return login_already_logged_in;
}
+ /* First, try to log in as if the supplied name is a display name */
found_user = getuser(&CC->user, 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;
int a;
extract(username, cmdbuf, 0);
- username[25] = 0;
- strproc(username);
+ striplt(username);
a = CtdlLoginExistingUser(username);
switch (a) {