...
 
Commits (2)
  • Rob Swindell's avatar
    Improve startup w/Config Wizard reliability · 351cf95a
    Rob Swindell authored
    I noticed on one particular system that Canceling or Completing
    the configuration wizard on a fresh install, sbbsctrl.exe would
    just shut down (no error dialog or anything, likely a crash of
    some kind). Instrumenting StartupTimerTick() didn't reveal anything
    useful (it ran to completion).
    
    By changing the method of launching the Configuration Wizard,
    I was able to eliminate this observed problem. Now, the StartupTimer
    runs twice on a fresh install (just once for a normal startup),
    and the second run of the StartupTimerTick starts the configuration
    wizard.
    
    I also reverted to the previous behavior of dynamically creating
    and destroying the wizard for each use. There's just too much state
    information to restore if the config wizard is run a second time.
    
    Also, removed a bunch of old Registry settings readings (v3.10/11
    upgrade support) and commented out code.
    351cf95a
  • Rob Swindell's avatar
    Don't allow invalid netmail-forwarding addresses · a2f5990b
    Rob Swindell authored
    Don't prompt a new user to forward email to their netmail address if they
    provided an invalid netmail address (not supported by the system).
    
    If a sysop has an invalid netmail address setup for forwarding, don't try to
    forward email (or new user feedback) to that address.
    
    Re-ordered the new user terminal questions a little bit (ask for the backspace
    key first, to get earlier manual PETSCII detection). I'm not sure why I was
    enabling AUTOTERM along with PETSCII before. Removed that as PETSCII cannot
    be auto-detected.
    a2f5990b
......@@ -262,6 +262,7 @@ void __fastcall TConfigWizard::FormShow(TObject *Sender)
DateUsRadioButton->Checked=true;
WizNotebook->PageIndex=0;
ProgressBar->Position=0;
ProgressBar->Max=WizNotebook->Pages->Count-1;
IllegalCharsLabel->Caption="Illegal characters: '"
ILLEGAL_QWKID_CHARS "'";
......@@ -323,14 +324,12 @@ void __fastcall TConfigWizard::NextButtonClick(TObject *Sender)
scfg.sys_misc|=SM_SYSVDELM;
scfg.sys_misc&=~SM_USRVDELM;
}
scfg.new_install=FALSE;
if(!save_cfg(&scfg,0)) {
Application->MessageBox("Error saving configuration"
,"ERROR",MB_OK|MB_ICONEXCLAMATION);
} else
refresh_cfg(&scfg);
Close();
return;
}
......
This diff is collapsed.
......@@ -492,6 +492,7 @@ public: // User declarations
TPageControl* __fastcall PageControl(int num);
int __fastcall PageNum(TPageControl* obj);
void __fastcall FormMinimize(TObject *Sender);
void __fastcall DisplayMainPanels(TObject *Sender);
TColor __fastcall ReadColor(TRegistry*, AnsiString);
void __fastcall WriteColor(TRegistry*, AnsiString, TColor);
void __fastcall ReadFont(AnsiString, TFont*);
......
......@@ -91,11 +91,15 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode,
bputs(text[UnknownUser]);
return(false);
}
if((l&NETMAIL) && (cfg.sys_misc&SM_FWDTONET) && !(mode & WM_NOFWD)) {
if((l&NETMAIL) && (cfg.sys_misc&SM_FWDTONET) && !(mode & WM_NOFWD) && !(useron.rest&FLAG('M'))) {
getuserrec(&cfg,usernumber,U_NETMAIL,LEN_NETMAIL,str);
bprintf(text[UserNetMail],str);
if((mode & WM_FORCEFWD) || text[ForwardMailQ][0]==0 || yesno(text[ForwardMailQ])) /* Forward to netmail address */
return(netmail(str, subj, mode, resmb, remsg));
if(is_supported_netmail_addr(&cfg, str)) {
bprintf(text[UserNetMail],str);
if((mode & WM_FORCEFWD) || yesno(text[ForwardMailQ])) /* Forward to netmail address */
return(netmail(str, subj, mode, resmb, remsg));
} else {
bprintf(text[InvalidNetMailAddr], str);
}
}
if(sys_status&SS_ABORT) {
bputs(text[Aborted]);
......
......@@ -1428,3 +1428,23 @@ bool sbbs_t::qnetmail(const char *into, const char *subj, long mode, smb_t* resm
logline("EN",str);
return(true);
}
extern "C" BOOL is_supported_netmail_addr(scfg_t* cfg, const char* addr)
{
switch (smb_netaddr_type(addr)) {
case NET_FIDO:
return INT_TO_BOOL(cfg->total_faddrs && (cfg->netmail_misc&NMAIL_ALLOW));
case NET_INTERNET:
return INT_TO_BOOL(cfg->inetmail_misc&NMAIL_ALLOW);
case NET_QWK:
{
char fulladdr[256] = "";
const char* p = strchr(addr, '@');
if(p == NULL)
return FALSE;
qwk_route(cfg, p + 1, fulladdr, sizeof(fulladdr)-1);
return fulladdr[0] != 0;
}
}
return FALSE;
}
......@@ -152,7 +152,26 @@ BOOL sbbs_t::newuser()
} else
useron.misc&=~AUTOTERM;
if(!(useron.misc&AUTOTERM)) {
while(text[HitYourBackspaceKey][0] && !(useron.misc&(PETSCII|SWAP_DELETE)) && online) {
bputs(text[HitYourBackspaceKey]);
uchar key = getkey(K_NONE);
bprintf(text[CharacterReceivedFmt], key, key);
if(key == '\b')
break;
if(key == DEL) {
if(text[SwapDeleteKeyQ][0] == 0 || yesno(text[SwapDeleteKeyQ]))
useron.misc |= SWAP_DELETE;
}
else if(key == PETSCII_DELETE)
useron.misc |= (PETSCII|COLOR);
else {
bprintf(text[InvalidBackspaceKeyFmt], key, key);
if(text[ContinueQ][0] && !yesno(text[ContinueQ]))
return FALSE;
}
}
if(!(useron.misc&(AUTOTERM|PETSCII))) {
if(text[AnsiTerminalQ][0] && yesno(text[AnsiTerminalQ]))
useron.misc|=ANSI;
else
......@@ -173,25 +192,6 @@ BOOL sbbs_t::newuser()
else
useron.rows = TERM_ROWS_DEFAULT;
while(text[HitYourBackspaceKey][0] && !(useron.misc&(PETSCII|SWAP_DELETE)) && online) {
bputs(text[HitYourBackspaceKey]);
uchar key = getkey(K_NONE);
bprintf(text[CharacterReceivedFmt], key, key);
if(key == '\b')
break;
if(key == DEL) {
if(text[SwapDeleteKeyQ][0] == 0 || yesno(text[SwapDeleteKeyQ]))
useron.misc |= SWAP_DELETE;
}
else if(key == PETSCII_DELETE)
useron.misc |= (AUTOTERM|PETSCII|COLOR);
else {
bprintf(text[InvalidBackspaceKeyFmt], key, key);
if(text[ContinueQ][0] && !yesno(text[ContinueQ]))
return FALSE;
}
}
if(useron.misc&PETSCII) {
autoterm |= PETSCII;
outcom(PETSCII_UPPERLOWER);
......@@ -328,10 +328,10 @@ BOOL sbbs_t::newuser()
&& !trashcan(useron.netmail,"email"))
break;
}
if(useron.netmail[0] && cfg.sys_misc&SM_FWDTONET && text[ForwardMailQ][0] && yesno(text[ForwardMailQ]))
useron.misc&=~NETMAIL;
if((cfg.sys_misc&SM_FWDTONET) && is_supported_netmail_addr(&cfg, useron.netmail) && yesno(text[ForwardMailQ]))
useron.misc|=NETMAIL;
else
useron.misc&=~NETMAIL;
if(text[UserInfoCorrectQ][0]==0 || yesno(text[UserInfoCorrectQ]))
break;
}
......
......@@ -1294,6 +1294,9 @@ extern "C" {
/* qwk.cpp */
DLLEXPORT int qwk_route(scfg_t*, const char *inaddr, char *fulladdr, size_t maxlen);
/* netmail.cpp */
DLLEXPORT BOOL is_supported_netmail_addr(scfg_t*, const char* addr);
/* con_out.cpp */
unsigned char cp437_to_petscii(unsigned char);
......
......@@ -1082,11 +1082,9 @@ void sbbs_t::maindflts(user_t* user)
if(sys_status&SS_ABORT)
break;
putuserrec(&cfg,user->number,U_NETMAIL,LEN_NETMAIL,user->netmail);
if(user->netmail[0] == 0 || noyes(text[ForwardMailQ]))
user->misc&=~NETMAIL;
else {
user->misc|=NETMAIL;
}
user->misc &= ~NETMAIL;
if(is_supported_netmail_addr(&cfg, user->netmail) && !noyes(text[ForwardMailQ]))
user->misc |= NETMAIL;
putuserrec(&cfg,user->number,U_MISC,8,ultoa(user->misc,str,16));
break;
case 'C':
......