diff --git a/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp b/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp index 3cef11cf300491ebccd57f606032713db8819340..69a09530316b17df03187d3c8f4c70766fb0d108 100644 --- a/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp +++ b/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp @@ -68,11 +68,14 @@ void __fastcall TFtpCfgDlg::FormShow(TObject *Sender) } MaxClientsEdit->Text=AnsiString((int)MainForm->ftp_startup.max_clients); MaxInactivityEdit->Text=AnsiString((int)MainForm->ftp_startup.max_inactivity); + QwkTimeoutEdit->Text=AnsiString((int)MainForm->ftp_startup.qwk_timeout); PortEdit->Text=AnsiString((int)MainForm->ftp_startup.port); AutoStartCheckBox->Checked=MainForm->FtpAutoStart; LogFileCheckBox->Checked=MainForm->FtpLogFile; IndexFileNameEdit->Text=AnsiString(MainForm->ftp_startup.index_file_name); + HtmlFileNameEdit->Text=AnsiString(MainForm->ftp_startup.html_index_file); + HtmlJavaScriptEdit->Text=AnsiString(MainForm->ftp_startup.html_index_script); AnswerSoundEdit->Text=AnsiString(MainForm->ftp_startup.answer_sound); HangupSoundEdit->Text=AnsiString(MainForm->ftp_startup.hangup_sound); CmdLogCheckBox->Checked=MainForm->ftp_startup.options&FTP_OPT_DEBUG_RX; @@ -87,6 +90,10 @@ void __fastcall TFtpCfgDlg::FormShow(TObject *Sender) =!(MainForm->ftp_startup.options&FTP_OPT_NO_HOST_LOOKUP); AutoIndexCheckBox->Checked=MainForm->ftp_startup.options&FTP_OPT_INDEX_FILE; AutoIndexCheckBoxClick(Sender); + HtmlIndexCheckBox->Checked + =MainForm->ftp_startup.options&FTP_OPT_HTML_INDEX_FILE; + HtmlIndexCheckBoxClick(Sender); + PageControl->ActivePage=GeneralTabSheet; } //--------------------------------------------------------------------------- @@ -116,6 +123,7 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender) MainForm->ftp_startup.interface_addr=0; MainForm->ftp_startup.max_clients=MaxClientsEdit->Text.ToIntDef(10); MainForm->ftp_startup.max_inactivity=MaxInactivityEdit->Text.ToIntDef(300); + MainForm->ftp_startup.qwk_timeout=QwkTimeoutEdit->Text.ToIntDef(600); MainForm->ftp_startup.port=PortEdit->Text.ToIntDef(23); MainForm->FtpAutoStart=AutoStartCheckBox->Checked; MainForm->FtpLogFile=LogFileCheckBox->Checked; @@ -123,6 +131,13 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender) sprintf(MainForm->ftp_startup.index_file_name,"%.*s" ,sizeof(MainForm->ftp_startup.index_file_name)-1 ,IndexFileNameEdit->Text.c_str()); + sprintf(MainForm->ftp_startup.html_index_file,"%.*s" + ,sizeof(MainForm->ftp_startup.html_index_file)-1 + ,HtmlFileNameEdit->Text.c_str()); + sprintf(MainForm->ftp_startup.html_index_script,"%.*s" + ,sizeof(MainForm->ftp_startup.html_index_script)-1 + ,HtmlJavaScriptEdit->Text.c_str()); + sprintf(MainForm->ftp_startup.answer_sound,"%.*s" ,sizeof(MainForm->ftp_startup.answer_sound)-1 ,AnswerSoundEdit->Text.c_str()); @@ -161,6 +176,10 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender) MainForm->ftp_startup.options|=FTP_OPT_INDEX_FILE; else MainForm->ftp_startup.options&=~FTP_OPT_INDEX_FILE; + if(HtmlIndexCheckBox->Checked==true) + MainForm->ftp_startup.options|=FTP_OPT_HTML_INDEX_FILE; + else + MainForm->ftp_startup.options&=~FTP_OPT_HTML_INDEX_FILE; MainForm->SaveSettings(Sender); } @@ -193,3 +212,20 @@ void __fastcall TFtpCfgDlg::AutoIndexCheckBoxClick(TObject *Sender) //--------------------------------------------------------------------------- +void __fastcall TFtpCfgDlg::HtmlJavaScriptButtonClick(TObject *Sender) +{ + OpenDialog->FileName=HtmlJavaScriptEdit->Text; + if(OpenDialog->Execute()==true) { + HtmlJavaScriptEdit->Text=OpenDialog->FileName; + } +} +//--------------------------------------------------------------------------- + +void __fastcall TFtpCfgDlg::HtmlIndexCheckBoxClick(TObject *Sender) +{ + HtmlFileNameEdit->Enabled=HtmlIndexCheckBox->Checked; + HtmlJavaScriptEdit->Enabled=HtmlIndexCheckBox->Checked; + HtmlJavaScriptLabel->Enabled=HtmlIndexCheckBox->Checked; +} +//--------------------------------------------------------------------------- + diff --git a/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm b/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm index 0d73d3e8c400ca0004d0f4e98530053704ce6c5f..cf8f98da2862b011b675371da86d1d143f4d0533 100644 --- a/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm +++ b/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm @@ -1,9 +1,9 @@ object FtpCfgDlg: TFtpCfgDlg - Left = 466 - Top = 622 + Left = 754 + Top = 408 BorderStyle = bsDialog Caption = 'FTP Server Configuration' - ClientHeight = 288 + ClientHeight = 301 ClientWidth = 352 Color = clBtnFace ParentFont = True @@ -16,48 +16,56 @@ object FtpCfgDlg: TFtpCfgDlg Left = 4 Top = 4 Width = 342 - Height = 229 - ActivePage = SoundTabSheet + Height = 245 + ActivePage = IndexTabSheet TabOrder = 0 object GeneralTabSheet: TTabSheet Caption = 'General' object MaxClientesLabel: TLabel Left = 9 - Top = 102 + Top = 106 Width = 96 - Height = 24 + Height = 25 AutoSize = False Caption = 'Max Clients' end object MaxInactivityLabel: TLabel Left = 9 - Top = 132 + Top = 138 Width = 96 - Height = 24 + Height = 25 AutoSize = False Caption = 'Max Inactivity' end object PortLabel: TLabel Left = 9 - Top = 68 + Top = 74 Width = 96 - Height = 24 + Height = 25 AutoSize = False Caption = 'Control Port' end object InterfaceLabel: TLabel Left = 9 - Top = 36 + Top = 42 Width = 96 - Height = 24 + Height = 25 AutoSize = False Caption = 'Interface (IP)' end + object QwkTimeoutLabel: TLabel + Left = 9 + Top = 170 + Width = 96 + Height = 25 + AutoSize = False + Caption = 'QWK Timeout' + end object AutoStartCheckBox: TCheckBox Left = 9 - Top = 6 + Top = 12 Width = 144 - Height = 24 + Height = 25 Hint = 'Automatically start FTP server' Caption = 'Auto Startup' ParentShowHint = False @@ -66,7 +74,7 @@ object FtpCfgDlg: TFtpCfgDlg end object MaxClientsEdit: TEdit Left = 105 - Top = 100 + Top = 106 Width = 48 Height = 24 Hint = 'Maximum number of simultaneous clients (default=10)' @@ -76,7 +84,7 @@ object FtpCfgDlg: TFtpCfgDlg end object MaxInactivityEdit: TEdit Left = 105 - Top = 132 + Top = 138 Width = 48 Height = 24 Hint = @@ -88,7 +96,7 @@ object FtpCfgDlg: TFtpCfgDlg end object PortEdit: TEdit Left = 105 - Top = 68 + Top = 74 Width = 48 Height = 24 Hint = 'TCP port to use for FTP control connections (default=21)' @@ -98,7 +106,7 @@ object FtpCfgDlg: TFtpCfgDlg end object NetworkInterfaceEdit: TEdit Left = 105 - Top = 36 + Top = 42 Width = 192 Height = 24 Hint = 'Your network adapter'#39's static IP address or blank for <ANY>' @@ -106,55 +114,35 @@ object FtpCfgDlg: TFtpCfgDlg ShowHint = True TabOrder = 2 end - object AutoIndexCheckBox: TCheckBox - Left = 9 - Top = 162 - Width = 96 - Height = 24 - Hint = 'Automatically generate index files for file descriptions' - Caption = 'Auto Index' - TabOrder = 6 - OnClick = AutoIndexCheckBoxClick - end - object IndexFileNameEdit: TEdit - Left = 105 - Top = 164 - Width = 192 - Height = 24 - Hint = 'Name of auto-index file (default=00index)' - ParentShowHint = False - ShowHint = True - TabOrder = 7 - end object AllowQWKCheckBox: TCheckBox Left = 182 - Top = 68 + Top = 74 Width = 147 - Height = 24 + Height = 25 Hint = 'Allow QWK packet transfers' Caption = 'QWK Packets' ParentShowHint = False ShowHint = True - TabOrder = 8 + TabOrder = 7 end object LocalFileSysCheckBox: TCheckBox Left = 182 - Top = 100 + Top = 106 Width = 147 - Height = 24 + Height = 25 Hint = 'Allow sysop access to local file system (requires sysop password' + ')' Caption = 'Local File System' ParentShowHint = False ShowHint = True - TabOrder = 9 + TabOrder = 8 end object HostnameCheckBox: TCheckBox Left = 182 - Top = 6 + Top = 12 Width = 147 - Height = 24 + Height = 25 Hint = 'Automatically lookup client'#39's hostnames via DNS' Caption = 'Hostname Lookup' ParentShowHint = False @@ -163,14 +151,90 @@ object FtpCfgDlg: TFtpCfgDlg end object DirFilesCheckBox: TCheckBox Left = 182 - Top = 129 + Top = 135 Width = 154 Height = 25 Hint = 'Allow users access to files in directory, but not in database' Caption = 'Directory File Access' ParentShowHint = False ShowHint = True - TabOrder = 10 + TabOrder = 9 + end + object QwkTimeoutEdit: TEdit + Left = 105 + Top = 170 + Width = 48 + Height = 24 + Hint = 'Maximum number of seconds before QWK packet creation timeout' + ParentShowHint = False + ShowHint = True + TabOrder = 6 + end + end + object IndexTabSheet: TTabSheet + Caption = 'Index' + ImageIndex = 3 + object HtmlJavaScriptLabel: TLabel + Left = 9 + Top = 76 + Width = 80 + Height = 25 + AutoSize = False + Caption = 'JavaScript' + end + object AutoIndexCheckBox: TCheckBox + Left = 9 + Top = 12 + Width = 96 + Height = 24 + Hint = 'Automatically generate index files for file descriptions' + Caption = 'ASCII' + ParentShowHint = False + ShowHint = True + TabOrder = 0 + OnClick = AutoIndexCheckBoxClick + end + object IndexFileNameEdit: TEdit + Left = 105 + Top = 12 + Width = 192 + Height = 24 + Hint = 'Name of ASCII index file (default=00index)' + ParentShowHint = False + ShowHint = True + TabOrder = 1 + end + object HtmlIndexCheckBox: TCheckBox + Left = 9 + Top = 44 + Width = 96 + Height = 24 + Hint = 'Automatically generate HTML index files for file descriptions' + Caption = 'HTML' + ParentShowHint = False + ShowHint = True + TabOrder = 2 + OnClick = HtmlIndexCheckBoxClick + end + object HtmlFileNameEdit: TEdit + Left = 105 + Top = 44 + Width = 192 + Height = 24 + Hint = 'Name of HTML index file (default=00index.html)' + ParentShowHint = False + ShowHint = True + TabOrder = 3 + end + object HtmlJavaScriptEdit: TEdit + Left = 105 + Top = 76 + Width = 192 + Height = 24 + Hint = 'JavaScript filename to execute to generate HTML index file' + ParentShowHint = False + ShowHint = True + TabOrder = 4 end end object LogTabSheet: TTabSheet @@ -178,7 +242,7 @@ object FtpCfgDlg: TFtpCfgDlg ImageIndex = 1 object DebugTxCheckBox: TCheckBox Left = 9 - Top = 36 + Top = 42 Width = 192 Height = 24 Hint = 'Log (debug) transmitted FTP responses' @@ -189,7 +253,7 @@ object FtpCfgDlg: TFtpCfgDlg end object CmdLogCheckBox: TCheckBox Left = 9 - Top = 6 + Top = 12 Width = 192 Height = 24 Hint = 'Log (debug) all received FTP commands' @@ -200,7 +264,7 @@ object FtpCfgDlg: TFtpCfgDlg end object DebugDataCheckBox: TCheckBox Left = 9 - Top = 66 + Top = 72 Width = 192 Height = 24 Hint = 'Log (debug) data channel operations' @@ -211,7 +275,7 @@ object FtpCfgDlg: TFtpCfgDlg end object LogFileCheckBox: TCheckBox Left = 9 - Top = 96 + Top = 102 Width = 144 Height = 25 Hint = 'Save log entries to a file (in your DATA directory)' @@ -241,9 +305,9 @@ object FtpCfgDlg: TFtpCfgDlg Caption = 'Disconnect' end object AnswerSoundEdit: TEdit - Left = 89 + Left = 105 Top = 12 - Width = 208 + Width = 192 Height = 24 Hint = 'Sound file to play when users connect' ParentShowHint = False @@ -260,9 +324,9 @@ object FtpCfgDlg: TFtpCfgDlg OnClick = AnswerSoundButtonClick end object HangupSoundEdit: TEdit - Left = 89 + Left = 105 Top = 44 - Width = 208 + Width = 192 Height = 24 Hint = 'Sound file to play when users disconnect' ParentShowHint = False @@ -282,7 +346,7 @@ object FtpCfgDlg: TFtpCfgDlg end object OKBtn: TButton Left = 25 - Top = 247 + Top = 260 Width = 93 Height = 30 Anchors = [akLeft, akBottom] @@ -294,7 +358,7 @@ object FtpCfgDlg: TFtpCfgDlg end object CancelBtn: TButton Left = 128 - Top = 247 + Top = 260 Width = 92 Height = 30 Anchors = [akLeft, akBottom] @@ -305,7 +369,7 @@ object FtpCfgDlg: TFtpCfgDlg end object ApplyBtn: TButton Left = 233 - Top = 247 + Top = 260 Width = 93 Height = 30 Anchors = [akLeft, akBottom] diff --git a/src/sbbs3/ctrl/FtpCfgDlgUnit.h b/src/sbbs3/ctrl/FtpCfgDlgUnit.h index 26d1085b42c7f2a07966cd925a97edf62b680310..9c048dd31c6e539746b47b3ce750b9895655de50 100644 --- a/src/sbbs3/ctrl/FtpCfgDlgUnit.h +++ b/src/sbbs3/ctrl/FtpCfgDlgUnit.h @@ -77,8 +77,6 @@ __published: TEdit *PortEdit; TLabel *InterfaceLabel; TEdit *NetworkInterfaceEdit; - TCheckBox *AutoIndexCheckBox; - TEdit *IndexFileNameEdit; TCheckBox *AllowQWKCheckBox; TCheckBox *LocalFileSysCheckBox; TCheckBox *HostnameCheckBox; @@ -86,11 +84,22 @@ __published: TButton *CancelBtn; TButton *ApplyBtn; TCheckBox *DirFilesCheckBox; + TTabSheet *IndexTabSheet; + TCheckBox *AutoIndexCheckBox; + TEdit *IndexFileNameEdit; + TCheckBox *HtmlIndexCheckBox; + TEdit *HtmlFileNameEdit; + TLabel *HtmlJavaScriptLabel; + TEdit *HtmlJavaScriptEdit; + TLabel *QwkTimeoutLabel; + TEdit *QwkTimeoutEdit; void __fastcall FormShow(TObject *Sender); void __fastcall OKBtnClick(TObject *Sender); void __fastcall AnswerSoundButtonClick(TObject *Sender); void __fastcall HangupSoundButtonClick(TObject *Sender); void __fastcall AutoIndexCheckBoxClick(TObject *Sender); + void __fastcall HtmlJavaScriptButtonClick(TObject *Sender); + void __fastcall HtmlIndexCheckBoxClick(TObject *Sender); private: public: virtual __fastcall TFtpCfgDlg(TComponent* AOwner);