Skip to content
Snippets Groups Projects
Commit 7e699dc4 authored by rswindell's avatar rswindell
Browse files

Allow more new user information prompts to be disabled by setting the prompt

text to an empty strings ("") in the ctrl/text.dat file, even the Name/Alias
prompt! Now this does mean that only terminal protocols where the username
is provided as part of the negotiation could be used to create new user
accounts (i.e. not Telnet), which I suppose could be fine for an RLogin-only
game server
.
If no user name is supplied by either protocol or prompt, an error is logged
and the function fails.
parent c82bc10d
No related branches found
No related tags found
No related merge requests found
...@@ -202,11 +202,11 @@ BOOL sbbs_t::newuser() ...@@ -202,11 +202,11 @@ BOOL sbbs_t::newuser()
if(rlogin_name[0]) if(rlogin_name[0])
SAFECOPY(useron.alias,rlogin_name); SAFECOPY(useron.alias,rlogin_name);
while(online) { char* prompt = text[EnterYourRealName];
if(cfg.uq&UQ_ALIASES) if(cfg.uq&UQ_ALIASES)
bputs(text[EnterYourAlias]); prompt = text[EnterYourAlias];
else while(*prompt && online) {
bputs(text[EnterYourRealName]); bputs(prompt);
getstr(useron.alias,LEN_ALIAS,kmode); getstr(useron.alias,LEN_ALIAS,kmode);
truncsp(useron.alias); truncsp(useron.alias);
if (!check_name(&cfg,useron.alias) if (!check_name(&cfg,useron.alias)
...@@ -220,7 +220,7 @@ BOOL sbbs_t::newuser() ...@@ -220,7 +220,7 @@ BOOL sbbs_t::newuser()
} }
if(!online) return(FALSE); if(!online) return(FALSE);
if((cfg.uq&UQ_ALIASES) && (cfg.uq&UQ_REALNAME)) { if((cfg.uq&UQ_ALIASES) && (cfg.uq&UQ_REALNAME)) {
while(online) { while(online && text[EnterYourRealName][0]) {
bputs(text[EnterYourRealName]); bputs(text[EnterYourRealName]);
getstr(useron.name,LEN_NAME,kmode); getstr(useron.name,LEN_NAME,kmode);
if (!check_name(&cfg,useron.name) if (!check_name(&cfg,useron.name)
...@@ -234,16 +234,20 @@ BOOL sbbs_t::newuser() ...@@ -234,16 +234,20 @@ BOOL sbbs_t::newuser()
return(FALSE); return(FALSE);
} }
} }
else if(cfg.uq&UQ_COMPANY) { else if(cfg.uq&UQ_COMPANY && text[EnterYourCompany][0]) {
bputs(text[EnterYourCompany]); bputs(text[EnterYourCompany]);
getstr(useron.name,LEN_NAME,(cfg.uq&UQ_NOEXASC)|K_EDIT|K_AUTODEL); getstr(useron.name,LEN_NAME,(cfg.uq&UQ_NOEXASC)|K_EDIT|K_AUTODEL);
} }
if(!useron.alias[0]) {
errormsg(WHERE, ERR_CHK, "alias", 0);
return FALSE;
}
if(!useron.name[0]) if(!useron.name[0])
SAFECOPY(useron.name,useron.alias); SAFECOPY(useron.name,useron.alias);
if(!online) return(FALSE); if(!online) return(FALSE);
if(!useron.handle[0]) if(!useron.handle[0])
SAFECOPY(useron.handle,useron.alias); SAFECOPY(useron.handle,useron.alias);
while((cfg.uq&UQ_HANDLE) && online) { while((cfg.uq&UQ_HANDLE) && online && text[EnterYourHandle][0]) {
bputs(text[EnterYourHandle]); bputs(text[EnterYourHandle]);
if(!getstr(useron.handle,LEN_HANDLE if(!getstr(useron.handle,LEN_HANDLE
,K_LINE|K_EDIT|K_AUTODEL|(cfg.uq&UQ_NOEXASC)) ,K_LINE|K_EDIT|K_AUTODEL|(cfg.uq&UQ_NOEXASC))
...@@ -259,13 +263,13 @@ BOOL sbbs_t::newuser() ...@@ -259,13 +263,13 @@ BOOL sbbs_t::newuser()
} }
if(!online) return(FALSE); if(!online) return(FALSE);
if(cfg.uq&UQ_ADDRESS) if(cfg.uq&UQ_ADDRESS)
while(online) { /* Get address and zip code */ while(online && text[EnterYourAddress][0]) { /* Get address and zip code */
bputs(text[EnterYourAddress]); bputs(text[EnterYourAddress]);
if(getstr(useron.address,LEN_ADDRESS,kmode)) if(getstr(useron.address,LEN_ADDRESS,kmode))
break; break;
} }
if(!online) return(FALSE); if(!online) return(FALSE);
while((cfg.uq&UQ_LOCATION) && online) { while((cfg.uq&UQ_LOCATION) && online && text[EnterYourCityState][0]) {
bputs(text[EnterYourCityState]); bputs(text[EnterYourCityState]);
if(getstr(useron.location,LEN_LOCATION,kmode) if(getstr(useron.location,LEN_LOCATION,kmode)
&& ((cfg.uq&UQ_NOCOMMAS) || strchr(useron.location,','))) && ((cfg.uq&UQ_NOCOMMAS) || strchr(useron.location,',')))
...@@ -274,14 +278,14 @@ BOOL sbbs_t::newuser() ...@@ -274,14 +278,14 @@ BOOL sbbs_t::newuser()
useron.location[0]=0; useron.location[0]=0;
} }
if(cfg.uq&UQ_ADDRESS) if(cfg.uq&UQ_ADDRESS)
while(online) { while(online && text[EnterYourZipCode][0]) {
bputs(text[EnterYourZipCode]); bputs(text[EnterYourZipCode]);
if(getstr(useron.zipcode,LEN_ZIPCODE if(getstr(useron.zipcode,LEN_ZIPCODE
,K_UPPER|(cfg.uq&UQ_NOEXASC)|K_EDIT|K_AUTODEL)) ,K_UPPER|(cfg.uq&UQ_NOEXASC)|K_EDIT|K_AUTODEL))
break; break;
} }
if(!online) return(FALSE); if(!online) return(FALSE);
if(cfg.uq&UQ_PHONE) { if((cfg.uq&UQ_PHONE) && text[EnterYourPhoneNumber][0]) {
if(text[CallingFromNorthAmericaQ][0]) if(text[CallingFromNorthAmericaQ][0])
usa=yesno(text[CallingFromNorthAmericaQ]); usa=yesno(text[CallingFromNorthAmericaQ]);
else else
...@@ -303,18 +307,18 @@ BOOL sbbs_t::newuser() ...@@ -303,18 +307,18 @@ BOOL sbbs_t::newuser()
} }
} }
if(!online) return(FALSE); if(!online) return(FALSE);
if(cfg.uq&UQ_SEX) { if((cfg.uq&UQ_SEX) && text[EnterYourSex][0]) {
bputs(text[EnterYourSex]); bputs(text[EnterYourSex]);
useron.sex=(char)getkeys("MF",0); useron.sex=(char)getkeys("MF",0);
} }
while((cfg.uq&UQ_BIRTH) && online) { while((cfg.uq&UQ_BIRTH) && online && text[EnterYourBirthday][0]) {
bprintf(text[EnterYourBirthday] bprintf(text[EnterYourBirthday]
,cfg.sys_misc&SM_EURODATE ? "DD/MM/YY" : "MM/DD/YY"); ,cfg.sys_misc&SM_EURODATE ? "DD/MM/YY" : "MM/DD/YY");
if(gettmplt(useron.birth,"nn/nn/nn",K_EDIT)==8 && getage(&cfg,useron.birth)) if(gettmplt(useron.birth,"nn/nn/nn",K_EDIT)==8 && getage(&cfg,useron.birth))
break; break;
} }
if(!online) return(FALSE); if(!online) return(FALSE);
while(!(cfg.uq&UQ_NONETMAIL) && online) { 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) if(getstr(useron.netmail,LEN_NETMAIL,K_EDIT|K_AUTODEL|K_LINE)
&& !trashcan(useron.netmail,"email")) && !trashcan(useron.netmail,"email"))
...@@ -353,7 +357,7 @@ BOOL sbbs_t::newuser() ...@@ -353,7 +357,7 @@ BOOL sbbs_t::newuser()
useron.xedit=0; useron.xedit=0;
} }
if(cfg.total_shells>1 && (cfg.uq&UQ_CMDSHELL)) { if(cfg.total_shells>1 && (cfg.uq&UQ_CMDSHELL) && text[CommandShellHeading][0]) {
for(i=0;i<cfg.total_shells;i++) for(i=0;i<cfg.total_shells;i++)
uselect(1,i,text[CommandShellHeading],cfg.shell[i]->name,cfg.shell[i]->ar); uselect(1,i,text[CommandShellHeading],cfg.shell[i]->name,cfg.shell[i]->ar);
if((int)(i=uselect(0,useron.shell,0,0,0))>=0) if((int)(i=uselect(0,useron.shell,0,0,0))>=0)
...@@ -415,7 +419,7 @@ BOOL sbbs_t::newuser() ...@@ -415,7 +419,7 @@ BOOL sbbs_t::newuser()
} }
if(!online) return(FALSE); if(!online) return(FALSE);
if(cfg.new_magic[0]) { if(cfg.new_magic[0] && text[MagicWordPrompt][0]) {
bputs(text[MagicWordPrompt]); bputs(text[MagicWordPrompt]);
str[0]=0; str[0]=0;
getstr(str,50,K_UPPER); getstr(str,50,K_UPPER);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment