Skip to content
Snippets Groups Projects
Commit fb43daf5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Implement duplicate new-user email address checking (optional)

If a sysop wants to prevent new users from using an email address of an existing user, they can set SCFG->System->New User Values->Question Toggles->Force Unique E-mail/NetMail to "Yes".

This partially addresses issue #127, at least for the terminal server.
parent bdb08f66
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2991 passed
...@@ -231,6 +231,7 @@ var UQ_NOCOMMAS =(1<<17); /* Do not require commas in location */ ...@@ -231,6 +231,7 @@ var UQ_NOCOMMAS =(1<<17); /* Do not require commas in location */
var UQ_NONETMAIL =(1<<18); /* Don't ask for e-mail/netmail address */ var UQ_NONETMAIL =(1<<18); /* Don't ask for e-mail/netmail address */
var UQ_NOUPRLWR =(1<<19); /* Don't force upper/lower case strings */ var UQ_NOUPRLWR =(1<<19); /* Don't force upper/lower case strings */
var UQ_COLORTERM =(1<<20); /* Ask if new user has color terminal */ var UQ_COLORTERM =(1<<20); /* Ask if new user has color terminal */
var UQ_DUPNETMAIL =(1<<21); /* Don't allow duplicate netmail address */
/********************************************/ /********************************************/
/********************************************/ /********************************************/
......
...@@ -322,8 +322,11 @@ BOOL sbbs_t::newuser() ...@@ -322,8 +322,11 @@ BOOL sbbs_t::newuser()
if(!online) return(FALSE); if(!online) return(FALSE);
while(!(cfg.uq&UQ_NONETMAIL) && online && text[EnterNetMailAddress][0]) { while(!(cfg.uq&UQ_NONETMAIL) && online && text[EnterNetMailAddress][0]) {
bputs(text[EnterNetMailAddress]); bputs(text[EnterNetMailAddress]);
if(getstr(useron.netmail,LEN_NETMAIL,K_EDIT|K_AUTODEL|K_LINE|K_TRIM) if(getstr(useron.netmail,LEN_NETMAIL,K_EDIT|K_AUTODEL|K_LINE|K_TRIM) < 1
&& !trashcan(useron.netmail,"email")) || trashcan(useron.netmail,"email")
|| ((cfg.uq & UQ_DUPNETMAIL) && userdatdupe(useron.number, U_NETMAIL, LEN_NETMAIL, useron.netmail)))
bputs(text[YouCantUseThatNetmail]);
else
break; break;
} }
useron.misc&=~NETMAIL; useron.misc&=~NETMAIL;
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
#define UQ_NONETMAIL (1L<<18) /* Don't ask for e-mail/netmail address */ #define UQ_NONETMAIL (1L<<18) /* Don't ask for e-mail/netmail address */
#define UQ_NOUPRLWR (1L<<19) /* Don't force upper/lower case strings */ #define UQ_NOUPRLWR (1L<<19) /* Don't force upper/lower case strings */
#define UQ_COLORTERM (1L<<20) /* Ask if new user has color terminal */ #define UQ_COLORTERM (1L<<20) /* Ask if new user has color terminal */
#define UQ_DUPNETMAIL (1L<<21) /* Don't allow duplicate e-mail address */
/* Different bits in sys_misc */ /* Different bits in sys_misc */
#define SM_CLOSED (1L<<0) /* System is clsoed to New Users */ #define SM_CLOSED (1L<<0) /* System is clsoed to New Users */
......
...@@ -1251,6 +1251,9 @@ void sys_cfg(void) ...@@ -1251,6 +1251,9 @@ void sys_cfg(void)
sprintf(opt[i++],"%-27.27s %-3.3s" sprintf(opt[i++],"%-27.27s %-3.3s"
,"E-mail/NetMail Address" ,"E-mail/NetMail Address"
,cfg.uq&UQ_NONETMAIL ? "No":"Yes"); ,cfg.uq&UQ_NONETMAIL ? "No":"Yes");
sprintf(opt[i++],"%-27.27s %-3.3s"
,"Force Unique E-mail/NetMail Address"
,cfg.uq&UQ_DUPNETMAIL ? "Yes":"No");
sprintf(opt[i++],"%-27.27s %-3.3s" sprintf(opt[i++],"%-27.27s %-3.3s"
,"Sex (Gender)" ,"Sex (Gender)"
,cfg.uq&UQ_SEX ? "Yes":"No"); ,cfg.uq&UQ_SEX ? "Yes":"No");
...@@ -1313,36 +1316,39 @@ void sys_cfg(void) ...@@ -1313,36 +1316,39 @@ void sys_cfg(void)
cfg.uq^=UQ_NONETMAIL; cfg.uq^=UQ_NONETMAIL;
break; break;
case 7: case 7:
cfg.uq^=UQ_SEX; cfg.uq^=UQ_DUPNETMAIL;
break; break;
case 8: case 8:
cfg.uq^=UQ_BIRTH; cfg.uq^=UQ_SEX;
break; break;
case 9: case 9:
cfg.uq^=UQ_ADDRESS; cfg.uq^=UQ_BIRTH;
break; break;
case 10: case 10:
cfg.uq^=UQ_LOCATION; cfg.uq^=UQ_ADDRESS;
break; break;
case 11: case 11:
cfg.uq^=UQ_NOCOMMAS; cfg.uq^=UQ_LOCATION;
break; break;
case 12: case 12:
cfg.uq^=UQ_PHONE; cfg.uq^=UQ_NOCOMMAS;
break; break;
case 13: case 13:
cfg.uq^=UQ_NOEXASC; cfg.uq^=UQ_PHONE;
break; break;
case 14: case 14:
cfg.uq^=UQ_XEDIT; cfg.uq^=UQ_NOEXASC;
break; break;
case 15: case 15:
cfg.uq^=UQ_CMDSHELL; cfg.uq^=UQ_XEDIT;
break; break;
case 16: case 16:
cfg.uq^=UQ_NODEF; cfg.uq^=UQ_CMDSHELL;
break; break;
case 17: case 17:
cfg.uq^=UQ_NODEF;
break;
case 18:
cfg.uq^=UQ_COLORTERM; cfg.uq^=UQ_COLORTERM;
break; break;
} }
......
...@@ -397,7 +397,7 @@ enum { ...@@ -397,7 +397,7 @@ enum {
,WhichXtrnProg ,WhichXtrnProg
,UserRunningXtrn ,UserRunningXtrn
,RemoveNodeLockQ ,RemoveNodeLockQ
,MinimumModemSpeed ,YouCantUseThatNetmail
,NoNodeAccess ,NoNodeAccess
,NodeLocked ,NodeLocked
,UnknownUser ,UnknownUser
......
...@@ -641,7 +641,8 @@ const char * const text_defaults[TOTAL_TEXT]={ ...@@ -641,7 +641,8 @@ const char * const text_defaults[TOTAL_TEXT]={
"\x6e\x6f\x64\x65\x20\x25\x64\x2e\x0d\x0a\x0d\x0a\x54\x72\x79\x20\x61\x67\x61\x69\x6e\x20\x6c\x61\x74\x65\x72\x2e\x0d\x0a\x0d\x0a" "\x6e\x6f\x64\x65\x20\x25\x64\x2e\x0d\x0a\x0d\x0a\x54\x72\x79\x20\x61\x67\x61\x69\x6e\x20\x6c\x61\x74\x65\x72\x2e\x0d\x0a\x0d\x0a"
"" // 385 UserRunningXtrn "" // 385 UserRunningXtrn
,"\x52\x65\x6d\x6f\x76\x65\x20\x6e\x6f\x64\x65\x20\x6c\x6f\x63\x6b" // 386 RemoveNodeLockQ ,"\x52\x65\x6d\x6f\x76\x65\x20\x6e\x6f\x64\x65\x20\x6c\x6f\x63\x6b" // 386 RemoveNodeLockQ
,"\x55\x4e\x55\x53\x45\x44\x33\x38\x37" // 387 MinimumModemSpeed ,"\x01\x6e\x59\x6f\x75\x20\x63\x61\x6e\x27\x74\x20\x75\x73\x65\x20\x74\x68\x61\x74\x20\x6d\x61\x69\x6c\x20\x61\x64\x64\x72\x65\x73"
"\x73\x20\x28\x64\x75\x70\x6c\x69\x63\x61\x74\x65\x20\x6f\x72\x20\x69\x6e\x76\x61\x6c\x69\x64\x29\x2e\x0d\x0a" // 387 YouCantUseThatNetmail
,"\x59\x6f\x75\x20\x64\x6f\x20\x6e\x6f\x74\x20\x68\x61\x76\x65\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6e\x74\x20\x61\x63\x63\x65\x73" ,"\x59\x6f\x75\x20\x64\x6f\x20\x6e\x6f\x74\x20\x68\x61\x76\x65\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6e\x74\x20\x61\x63\x63\x65\x73"
"\x73\x20\x66\x6f\x72\x20\x74\x68\x69\x73\x20\x6e\x6f\x64\x65\x2e" // 388 NoNodeAccess "\x73\x20\x66\x6f\x72\x20\x74\x68\x69\x73\x20\x6e\x6f\x64\x65\x2e" // 388 NoNodeAccess
,"\x01\x6e\x01\x72\x01\x68\x0d\x0a\x53\x6f\x72\x72\x79\x2c\x20\x74\x68\x69\x73\x20\x6e\x6f\x64\x65\x20\x69\x73\x20\x74\x65\x6d\x70" ,"\x01\x6e\x01\x72\x01\x68\x0d\x0a\x53\x6f\x72\x72\x79\x2c\x20\x74\x68\x69\x73\x20\x6e\x6f\x64\x65\x20\x69\x73\x20\x74\x65\x6d\x70"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment