Annotation of sbbs/sbbs3/ctrl/configwizardunit.cpp, revision 1.1.1.1

1.1       root        1: /* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
                      2: 
                      3: /* $Id: ConfigWizardUnit.cpp,v 1.19 2004/12/30 08:11:40 rswindell Exp $ */
                      4: 
                      5: /****************************************************************************
                      6:  * @format.tab-size 4          (Plain Text/Source Code File Header)                    *
                      7:  * @format.use-tabs true       (see http://www.synchro.net/ptsc_hdr.html)              *
                      8:  *                                                                                                                                                     *
                      9:  * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html         *
                     10:  *                                                                                                                                                     *
                     11:  * This program is free software; you can redistribute it and/or                       *
                     12:  * modify it under the terms of the GNU General Public License                         *
                     13:  * as published by the Free Software Foundation; either version 2                      *
                     14:  * of the License, or (at your option) any later version.                                      *
                     15:  * See the GNU General Public License for more details: gpl.txt or                     *
                     16:  * http://www.fsf.org/copyleft/gpl.html                                                                                *
                     17:  *                                                                                                                                                     *
                     18:  * Anonymous FTP access to the most recent released source is available at     *
                     19:  * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net     *
                     20:  *                                                                                                                                                     *
                     21:  * Anonymous CVS access to the development source and modification history     *
                     22:  * is available at cvs.synchro.net:/cvsroot/sbbs, example:                                     *
                     23:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs login                       *
                     24:  *     (just hit return, no password is necessary)                                                     *
                     25:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src                *
                     26:  *                                                                                                                                                     *
                     27:  * For Synchronet coding style and modification guidelines, see                                *
                     28:  * http://www.synchro.net/source.html                                                                          *
                     29:  *                                                                                                                                                     *
                     30:  * You are encouraged to submit any modifications (preferably in Unix diff     *
                     31:  * format) via e-mail to [email protected]                                                                      *
                     32:  *                                                                                                                                                     *
                     33:  * Note: If this box doesn't appear square, then you need to fix your tabs.    *
                     34:  ****************************************************************************/
                     35: //---------------------------------------------------------------------------
                     36: 
                     37: #include <vcl.h>
                     38: #pragma hdrstop
                     39: 
                     40: #include "MainFormUnit.h"
                     41: #include "ConfigWizardUnit.h"
                     42: #include <stdio.h>      // sprintf
                     43: #include <winsock.h>    // addresses and such
                     44: #include <iphlpapi.h>  // GetNetworkParams
                     45: 
                     46: //---------------------------------------------------------------------------
                     47: #pragma package(smart_init)
                     48: #pragma resource "*.dfm"
                     49: 
                     50: #define ILLEGAL_FILENAME_CHARS "\\/|<>+[]:=\";,%"
                     51: #define ILLEGAL_QWKID_CHARS  "*?" ILLEGAL_FILENAME_CHARS
                     52: 
                     53: char ctrl_dir[MAX_PATH+1];
                     54: short tz_val[]= {
                     55:      0
                     56:     ,AST
                     57:     ,EST
                     58:     ,CST
                     59:     ,MST
                     60:     ,PST
                     61:     ,YST
                     62:     ,HST
                     63:     ,BST
                     64:     ,MID
                     65:     ,VAN
                     66:     ,EDM
                     67:     ,WIN
                     68:     ,BOG
                     69:     ,CAR
                     70:     ,RIO
                     71:     ,FER
                     72:     ,AZO
                     73:     ,LON
                     74:     ,BER
                     75:     ,ATH
                     76:     ,MOS
                     77:     ,DUB
                     78:     ,KAB
                     79:     ,KAR
                     80:     ,BOM
                     81:     ,KAT
                     82:     ,DHA
                     83:     ,BAN
                     84:     ,HON
                     85:     ,TOK
                     86:     ,SYD
                     87:     ,NOU
                     88:     ,WEL
                     89: };
                     90: 
                     91: char* tz_str[]={
                     92:      "Universal (UTC/GMT)"
                     93:     ,"U.S. - Atlantic"
                     94:     ,"U.S. - Eastern"
                     95:     ,"U.S. - Central"
                     96:     ,"U.S. - Mountain"
                     97:     ,"U.S. - Pacific"
                     98:     ,"U.S. - Yukon"
                     99:     ,"U.S. - Hawaii/Alaska"
                    100:     ,"U.S. - Bering"
                    101:     ,"Midway"
                    102:     ,"Vancouver"
                    103:     ,"Edmonton"
                    104:     ,"Winnipeg"
                    105:     ,"Bogota"
                    106:     ,"Caracas"
                    107:     ,"Rio de Janeiro"
                    108:     ,"Fernando de Noronha"
                    109:     ,"Azores"
                    110:     ,"London"
                    111:     ,"Berlin"
                    112:     ,"Athens"
                    113:     ,"Moscow"
                    114:     ,"Dubai"
                    115:     ,"Kabul"
                    116:     ,"Karachi"
                    117:     ,"Bombay"
                    118:     ,"Kathmandu"
                    119:     ,"Dhaka"
                    120:     ,"Bangkok"
                    121:     ,"Hong Kong"
                    122:     ,"Tokyo"
                    123:     ,"Sydney"
                    124:     ,"Noumea"
                    125:     ,"Wellington"
                    126: };
                    127: 
                    128: //---------------------------------------------------------------------------
                    129: __fastcall TConfigWizard::TConfigWizard(TComponent* Owner)
                    130:     : TForm(Owner)
                    131: {
                    132: }
                    133: //---------------------------------------------------------------------------
                    134: void __fastcall TConfigWizard::FormShow(TObject *Sender)
                    135: {
                    136:     char str[512];
                    137:     int i;
                    138:     int status;
                    139: 
                    140:        Application->BringToFront();
                    141: 
                    142:     memset(&scfg,0,sizeof(scfg));
                    143:     SAFECOPY(scfg.ctrl_dir,MainForm->global.ctrl_dir);
                    144:     scfg.size=sizeof(scfg);
                    145:     char error[256];
                    146:        SAFECOPY(error,UNKNOWN_LOAD_ERROR);
                    147:     if(!load_cfg(&scfg,NULL,FALSE,error)) {
                    148:         Application->MessageBox(error,"ERROR Loadin Configuration"
                    149:                ,MB_OK|MB_ICONEXCLAMATION);
                    150:         Close();
                    151:         return;
                    152:     }
                    153: 
                    154:     if(scfg.new_install) {
                    155:         TIME_ZONE_INFORMATION tz;
                    156:            memset(&tz,0,sizeof(tz));
                    157:        DWORD tzRet=GetTimeZoneInformation(&tz);
                    158: 
                    159:         /* Convert to SMB tz format */
                    160:         scfg.sys_timezone=0;
                    161:                if(tz.Bias>0) {
                    162:                switch(tz.Bias|US_ZONE) {
                    163:                                case AST:
                    164:                                case EST:
                    165:                                case CST:
                    166:                                case MST:
                    167:                                case PST:
                    168:                                case YST:
                    169:                                case HST:
                    170:                                case BST:
                    171:                        scfg.sys_timezone=tz.Bias|US_ZONE;
                    172:                                if(tzRet==TIME_ZONE_ID_DAYLIGHT)
                    173:                                        scfg.sys_timezone|=DAYLIGHT;
                    174:                     break;
                    175:                 default:
                    176:                                        scfg.sys_timezone=tz.Bias|WESTERN_ZONE;
                    177:                     break;
                    178:             }
                    179:                } else if(tz.Bias<0)
                    180:                        scfg.sys_timezone=(-tz.Bias)|EASTERN_ZONE;
                    181: 
                    182:         /* Get DNS Server Address */
                    183: #if 0 /* Old way */
                    184:         sprintf(str,"%s /c ipconfig /all > %sipconfig.txt"
                    185:             ,getenv("COMSPEC"),scfg.ctrl_dir);
                    186:         WinExec(str,SW_HIDE);   /* there's got to be a better way! */
                    187:         Sleep(1500);   /* give ipconfig time to run */
                    188:         sprintf(str,"%sipconfig.txt",scfg.ctrl_dir);
                    189:         FILE*   fp=fopen(str,"r");
                    190:         if(fp==NULL) {
                    191:             sprintf(error,"Error %d (%s) opening %s"
                    192:                ,errno,strerror(errno),str);
                    193:                Application->MessageBox(error
                    194:                ,"ERROR",MB_OK|MB_ICONEXCLAMATION);
                    195:         } else {
                    196:             char*   p;
                    197:             if(fp!=NULL) {
                    198:                 while(!feof(fp)) {
                    199:                     if(!fgets(str,sizeof(str),fp))
                    200:                         break;
                    201:     #if 0
                    202:                     Application->MessageBox(str
                    203:                         ,"DEBUG",MB_OK|MB_ICONEXCLAMATION);
                    204:     #endif
                    205:                     p=str;
                    206:                     while(*p && *p<=' ') p++;
                    207:                     if(!strnicmp(p,"DNS Servers",11) && (p=strchr(p,':'))!=NULL) {
                    208:                         p++;
                    209:                         while(*p && *p<=' ') p++;
                    210:                         truncsp(p);
                    211:                         if((*p)==0)
                    212:                           continue;
                    213:                         SAFECOPY(MainForm->mail_startup.dns_server,p);
                    214:                         break;
                    215:                     }
                    216:                 }
                    217:                 fclose(fp);
                    218:             }
                    219:         }
                    220: #else  /* New way (finally!) */
                    221:                FIXED_INFO* FixedInfo=NULL;
                    222:                ULONG           FixedInfoLen=0;
                    223:                if(GetNetworkParams(FixedInfo,&FixedInfoLen) == ERROR_BUFFER_OVERFLOW) {
                    224:             FixedInfo=(FIXED_INFO*)malloc(FixedInfoLen);
                    225:                        if(GetNetworkParams(FixedInfo,&FixedInfoLen) == ERROR_SUCCESS)
                    226:                    SAFECOPY(MainForm->mail_startup.dns_server
                    227:                            ,FixedInfo->DnsServerList.IpAddress.String);
                    228:             if(FixedInfo!=NULL)
                    229:                 free(FixedInfo);
                    230:         }
                    231: #endif
                    232:     } else {
                    233:         SystemNameEdit->Text=AnsiString(scfg.sys_name);
                    234:         SystemLocationEdit->Text=AnsiString(scfg.sys_location);
                    235:         SysopNameEdit->Text=AnsiString(scfg.sys_op);
                    236:         SystemPasswordEdit->Text=AnsiString(scfg.sys_pass);
                    237:         InternetAddressComboBox->Text=AnsiString(scfg.sys_inetaddr);
                    238:         QWKIDEdit->Text=AnsiString(scfg.sys_id);
                    239:         QNetTaglineEdit->Text=AnsiString(scfg.qnet_tagline);
                    240:         AllNodesTelnetCheckBox->Checked
                    241:             =(scfg.sys_nodes==MainForm->bbs_startup.last_node);
                    242:     }
                    243: 
                    244:     NewUsersCheckBox->Checked=!(scfg.sys_misc&SM_CLOSED);
                    245:     FeedbackCheckBox->Checked=scfg.node_valuser;
                    246:     AliasesCheckBox->Checked=scfg.uq&UQ_ALIASES;
                    247:     NewUsersCheckBoxClick(Sender);
                    248: 
                    249:     if(scfg.sys_misc&SM_USRVDELM)
                    250:         DeletedEmailYesButton->Checked=true;
                    251:     else if(scfg.sys_misc&SM_SYSVDELM)
                    252:         DeletedEmailSysopButton->Checked=true;
                    253:     else
                    254:         DeletedEmailNoButton->Checked=true;
                    255: 
                    256:     DNSAddressEdit->Text=MainForm->mail_startup.dns_server;
                    257:     MaxMailUpDown->Position=MainForm->mail_startup.max_clients;
                    258:     MaxFtpUpDown->Position=MainForm->ftp_startup.max_clients;
                    259:     MaxWebUpDown->Position=MainForm->web_startup.max_clients;
                    260:     NodesUpDown->Position=scfg.sys_nodes;
                    261: 
                    262:     for(i=0;i<sizeof(tz_str)/sizeof(tz_str[0]);i++) {
                    263:         char str[128];
                    264:         if(tz_val[i] && !(tz_val[i]&US_ZONE))
                    265:             sprintf(str,"%c%u:%02u %s"
                    266:                 ,tz_val[i]&WESTERN_ZONE ? '-':'+'
                    267:                 ,(tz_val[i]&0xfff)/60
                    268:                 ,(tz_val[i]&0xfff)%60
                    269:                 ,tz_str[i]
                    270:                 );
                    271:         else
                    272:             strcpy(str,tz_str[i]);
                    273:         TimeZoneComboBox->Items->Add(str);
                    274:     }
                    275:        sprintf(str,"Other (%s)",smb_zonestr(scfg.sys_timezone,NULL));
                    276:     TimeZoneComboBox->Items->Add(str);
                    277: 
                    278:     for(i=0;i<sizeof(tz_val)/sizeof(tz_val[0]);i++)
                    279:         if((scfg.sys_timezone&((short)~DAYLIGHT))==tz_val[i])
                    280:             break;
                    281:     TimeZoneComboBox->ItemIndex=i;
                    282:     DaylightCheckBox->Enabled=scfg.sys_timezone&US_ZONE;
                    283:     DaylightCheckBox->Checked=scfg.sys_timezone&DAYLIGHT;
                    284:     if(scfg.sys_misc&SM_MILITARY)
                    285:         Time24hrRadioButton->Checked=true;
                    286:     else
                    287:         Time12hrRadioButton->Checked=true;
                    288:     if(scfg.sys_misc&SM_EURODATE)
                    289:         DateEuRadioButton->Checked=true;
                    290:     else
                    291:         DateUsRadioButton->Checked=true;
                    292: 
                    293:     WizNotebook->PageIndex=0;
                    294:     ProgressBar->Max=WizNotebook->Pages->Count-1;
                    295:     IllegalCharsLabel->Caption="Illegal characters: '"
                    296:         ILLEGAL_QWKID_CHARS "'";
                    297: 
                    298:        NextButton->Enabled=true;
                    299: }
                    300: //---------------------------------------------------------------------------
                    301: void __fastcall TConfigWizard::NextButtonClick(TObject *Sender)
                    302: {
                    303:     if(ProgressBar->Position==ProgressBar->Max) /* Finished */
                    304:     {
                    305:         // Write Registry keys
                    306:         if(AllNodesTelnetCheckBox->Checked)
                    307:             MainForm->bbs_startup.last_node=NodesUpDown->Position;
                    308:         MainForm->ftp_startup.max_clients=MaxFtpUpDown->Position;
                    309:         MainForm->mail_startup.max_clients=MaxMailUpDown->Position;
                    310:         MainForm->web_startup.max_clients=MaxWebUpDown->Position;
                    311:         strcpy(MainForm->mail_startup.dns_server,DNSAddressEdit->Text.c_str());
                    312: 
                    313:         MainForm->SaveIniSettings(Sender);
                    314: 
                    315:         // Write CNF files
                    316:         strcpy(scfg.sys_name,SystemNameEdit->Text.c_str());
                    317:         strcpy(scfg.sys_id,QWKIDEdit->Text.c_str());
                    318:         strcpy(scfg.sys_location,SystemLocationEdit->Text.c_str());
                    319:         strcpy(scfg.sys_op,SysopNameEdit->Text.c_str());
                    320:         strcpy(scfg.sys_pass,SystemPasswordEdit->Text.c_str());
                    321:         strcpy(scfg.sys_inetaddr,InternetAddressComboBox->Text.c_str());
                    322:         strcpy(scfg.qnet_tagline,QNetTaglineEdit->Text.c_str());
                    323:         scfg.sys_nodes=NodesUpDown->Position;
                    324:         if(TimeZoneComboBox->ItemIndex>=0
                    325:                && TimeZoneComboBox->ItemIndex<=sizeof(tz_val)/sizeof(tz_val[0]))
                    326:             scfg.sys_timezone=tz_val[TimeZoneComboBox->ItemIndex];
                    327:         if(DaylightCheckBox->Checked)
                    328:             scfg.sys_timezone|=DAYLIGHT;
                    329:         if(Time24hrRadioButton->Checked)
                    330:             scfg.sys_misc|=SM_MILITARY;
                    331:         else
                    332:             scfg.sys_misc&=~SM_MILITARY;
                    333:         if(DateEuRadioButton->Checked)
                    334:             scfg.sys_misc|=SM_EURODATE;
                    335:         else
                    336:             scfg.sys_misc&=~SM_EURODATE;
                    337:         if(NewUsersCheckBox->Checked)
                    338:             scfg.sys_misc&=~SM_CLOSED;
                    339:         else
                    340:             scfg.sys_misc|=SM_CLOSED;
                    341:         if(AliasesCheckBox->Checked)
                    342:             scfg.uq|=UQ_ALIASES;
                    343:         else
                    344:             scfg.uq&=~UQ_ALIASES;
                    345:         scfg.node_valuser=FeedbackCheckBox->Checked;
                    346: 
                    347:         if(DeletedEmailYesButton->Checked)
                    348:             scfg.sys_misc|=(SM_USRVDELM|SM_SYSVDELM);
                    349:         else if(DeletedEmailNoButton->Checked)
                    350:             scfg.sys_misc&=~(SM_USRVDELM|SM_SYSVDELM);
                    351:         else {
                    352:             scfg.sys_misc|=SM_SYSVDELM;
                    353:             scfg.sys_misc&=~SM_USRVDELM;
                    354:         }
                    355: 
                    356:         scfg.new_install=FALSE;
                    357:         if(!save_cfg(&scfg,0)) {
                    358:                Application->MessageBox("Error saving configuration"
                    359:                ,"ERROR",MB_OK|MB_ICONEXCLAMATION);
                    360:         } else
                    361:                refresh_cfg(&scfg);
                    362: 
                    363:         Close();
                    364:         return;
                    365:     }
                    366:     WizNotebook->PageIndex++;
                    367:     ProgressBar->Position=WizNotebook->PageIndex;
                    368:     if(ProgressBar->Position==ProgressBar->Max) /* Last page */
                    369:         NextButton->Caption="&Finish";
                    370: }
                    371: //---------------------------------------------------------------------------
                    372: void __fastcall TConfigWizard::BackButtonClick(TObject *Sender)
                    373: {
                    374:     WizNotebook->PageIndex--;
                    375:     ProgressBar->Position=WizNotebook->PageIndex;
                    376:     NextButton->Caption="&Next >";
                    377: }
                    378: //---------------------------------------------------------------------------
                    379: void __fastcall TConfigWizard::CancelButtonClick(TObject *Sender)
                    380: {
                    381:     Close();
                    382: }
                    383: //---------------------------------------------------------------------------
                    384: void __fastcall TConfigWizard::LogoImageClick(TObject *Sender)
                    385: {
                    386:     LogoImage->Visible=false;
                    387:     ProgressBar->Visible=false;
                    388: }
                    389: //---------------------------------------------------------------------------
                    390: void __fastcall TConfigWizard::TitleLabelClick(TObject *Sender)
                    391: {
                    392:     LogoImage->Visible=true;
                    393:     ProgressBar->Visible=true;
                    394: }
                    395: //---------------------------------------------------------------------------
                    396: void __fastcall TConfigWizard::WizNotebookPageChanged(TObject *Sender)
                    397: {
                    398:     TFont* current;
                    399: 
                    400:     switch(WizNotebook->PageIndex) {
                    401:         case 0:
                    402:             current=IntroductionLabel->Font;
                    403:             NextButton->Enabled=true;
                    404:             break;
                    405:         case 1:
                    406:             current=IdentificationLabel->Font;
                    407: //            ActiveControl=SystemNameEdit;
                    408:             if(!SysopNameEdit->Text.Length()) {
                    409:                 char username[41];
                    410:                 DWORD len=sizeof(username)-1;
                    411:                 GetUserName(username,&len);
                    412:                 SysopNameEdit->Text=AnsiString(username);
                    413:             }
                    414:             if(!SystemNameEdit->Text.Length()) {
                    415:                 char bbsname[41];
                    416:                 DWORD len=sizeof(bbsname)-1;
                    417:                 GetComputerName(bbsname,&len);
                    418:                 SystemNameEdit->Text=AnsiString(bbsname);
                    419:             }
                    420:             VerifyIdentification(Sender);
                    421:             break;
                    422:         case 2:
                    423:             current=TimeLabel->Font;
                    424:             NextButton->Enabled=true;
                    425:             break;
                    426:         case 3:
                    427:             current=InternetLabel->Font;
                    428:             if(!InternetAddressComboBox->Items->Count) {
                    429:                 WSADATA WSAData;
                    430:                 WSAStartup(MAKEWORD(1,1), &WSAData); /* req'd for gethostname */
                    431:                 if(scfg.sys_inetaddr[0])
                    432:                     InternetAddressComboBox->Items->Add(scfg.sys_inetaddr);
                    433:                 char hostname[128];
                    434:                 gethostname(hostname,sizeof(hostname)-1);
                    435:                 if(hostname[0]) {
                    436:                     InternetAddressComboBox->Items->Add(hostname);
                    437:                     HOSTENT* host=gethostbyname(hostname);
                    438:                     SOCKADDR_IN addr;
                    439:                     for(int i=0;host && host->h_addr_list[i];i++) {
                    440:                         addr.sin_addr.s_addr
                    441:                             =*((DWORD*)host->h_addr_list[i]);
                    442:                         InternetAddressComboBox->Items->Add(inet_ntoa(addr.sin_addr));
                    443:                     }
                    444:                 }
                    445:                 WSACleanup();
                    446:                 InternetAddressComboBox->ItemIndex=0;
                    447:             }
                    448:             VerifyInternetAddresses(Sender);
                    449:             break;
                    450:         case 4:
                    451:             current=QWKLabel->Font;
                    452:             if(!QWKIDEdit->Text.Length()) {
                    453:                 char bbsname[41];
                    454:                 char qwkid[9];
                    455:                 int len=0;
                    456:                 strcpy(bbsname,SystemNameEdit->Text.UpperCase().c_str());
                    457:                 for(char*p=bbsname;*p && len<8;p++) {
                    458:                     if(strchr(ILLEGAL_QWKID_CHARS,*p))
                    459:                         continue;
                    460:                     if(!len && isdigit(*p))
                    461:                         continue;
                    462:                     if(*p<=' ')
                    463:                         continue;
                    464:                     qwkid[len++]=*p;
                    465:                 }
                    466:                 qwkid[len]=0;
                    467:                 QWKIDEdit->Text=AnsiString(qwkid);
                    468:             }
                    469:             if(!QNetTaglineEdit->Text.Length()) {
                    470:                 QNetTaglineEdit->Text = SystemNameEdit->Text +
                    471:                     " - " + InternetAddressComboBox->Text;
                    472:             }
                    473:             VerifyQWK(Sender);
                    474:             break;
                    475:         case 5:
                    476:             current=MaximumsLabel->Font;
                    477:             NextButton->Enabled=true;
                    478:             break;
                    479:         case 6:
                    480:             current=OptionsLabel->Font;
                    481:             NextButton->Enabled=true;
                    482:             break;
                    483:         case 7:
                    484:             current=VerifyLabel->Font;
                    485:             VerifyPassword(Sender);
                    486:             if(!NextButton->Enabled)
                    487:                 ActiveControl=SysPassVerifyEdit;
                    488:             break;
                    489:         case 8:
                    490:             current=CompleteLabel->Font;
                    491:             break;
                    492:         default:
                    493:             return;
                    494:     }
                    495: 
                    496:     /* default to inactive */
                    497:     IntroductionLabel->Font->Color=clGray;
                    498:     IdentificationLabel->Font->Color=clGray;
                    499:     QWKLabel->Font->Color=clGray;
                    500:     TimeLabel->Font->Color=clGray;
                    501:     InternetLabel->Font->Color=clGray;
                    502:     MaximumsLabel->Font->Color=clGray;
                    503:     OptionsLabel->Font->Color=clGray;
                    504:     VerifyLabel->Font->Color=clGray;
                    505:     CompleteLabel->Font->Color=clGray;
                    506: 
                    507:     /* active */
                    508:     current->Color=clYellow;
                    509: 
                    510:     BackButton->Enabled=WizNotebook->PageIndex;
                    511: }
                    512: //---------------------------------------------------------------------------
                    513: void __fastcall TConfigWizard::VerifyIdentification(TObject *Sender)
                    514: {
                    515:     NextButton->Enabled=(SystemNameEdit->Text.Length()
                    516:         && SystemLocationEdit->Text.Length()
                    517:         && SysopNameEdit->Text.Length()
                    518:         && SystemPasswordEdit->Text.Length()
                    519:     );
                    520: }
                    521: //---------------------------------------------------------------------------
                    522: void __fastcall TConfigWizard::VerifyPassword(TObject *Sender)
                    523: {
                    524:     NextButton->Enabled=(SystemPasswordEdit->Text==SysPassVerifyEdit->Text);
                    525: }
                    526: //---------------------------------------------------------------------------
                    527: void __fastcall TConfigWizard::VerifyQWK(TObject *Sender)
                    528: {
                    529:     char    qwk_id[9];
                    530: 
                    531:     SAFECOPY(qwk_id,QWKIDEdit->Text.c_str());
                    532:     NextButton->Enabled=(
                    533:         strlen(qwk_id)>=2
                    534:         && isalpha(qwk_id[0])
                    535:         && strcspn(qwk_id,ILLEGAL_QWKID_CHARS)==strlen(qwk_id)
                    536:         && QNetTaglineEdit->Text.Length());
                    537: }
                    538: //---------------------------------------------------------------------------
                    539: void __fastcall TConfigWizard::QNetTaglineEditKeyPress(TObject *Sender,
                    540:       char &Key)
                    541: {
                    542:     if(Key==1)  /* Ctrl-A */
                    543:         QNetTaglineEdit->SetSelTextBuf("\1");
                    544: }
                    545: //---------------------------------------------------------------------------
                    546: 
                    547: void __fastcall TConfigWizard::VerifyInternetAddresses(TObject *Sender)
                    548: {
                    549:     NextButton->Enabled=(InternetAddressComboBox->Text.Length()
                    550:         && DNSAddressEdit->Text.Length());
                    551: }
                    552: //---------------------------------------------------------------------------
                    553: void __fastcall TConfigWizard::TimeZoneComboBoxChange(TObject *Sender)
                    554: {
                    555:     if(TimeZoneComboBox->ItemIndex>=0
                    556:        && TimeZoneComboBox->ItemIndex<=sizeof(tz_val)/sizeof(tz_val[0]))
                    557:         DaylightCheckBox->Enabled=tz_val[TimeZoneComboBox->ItemIndex]&US_ZONE;
                    558:     else
                    559:            DaylightCheckBox->Enabled=false;
                    560:     if(!DaylightCheckBox->Enabled)
                    561:         DaylightCheckBox->Checked=false;
                    562: }
                    563: //---------------------------------------------------------------------------
                    564: 
                    565: void __fastcall TConfigWizard::NewUsersCheckBoxClick(TObject *Sender)
                    566: {
                    567:     AliasesCheckBox->Enabled=NewUsersCheckBox->Checked;
                    568:     FeedbackCheckBox->Enabled=NewUsersCheckBox->Checked;
                    569: }
                    570: //---------------------------------------------------------------------------
                    571: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.